Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Title_bar color

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Licht_denker47
How do I cheat?
Reputation: 0

Joined: 18 Apr 2020
Posts: 2

PostPosted: Sat Apr 18, 2020 12:26 pm    Post subject: Title_bar color Reply with quote

Title_bar color
Is there any way to change it?
Google returns ~"how to change font color"

PS:
Im guessing no because form designer doesnt have the property?
But I wanted to confirm with someone with more experience



cswin-02.png
 Description:
 Filesize:  5.22 KB
 Viewed:  1709 Time(s)

cswin-02.png


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Apr 20, 2020 6:31 am    Post subject: Reply with quote

Cheat Engine form GUI color depending on System Colors or Windows Theme on Windows operating system.

You can change form title bar background color by some innovation, using get title bar client rectangle and re-draw (search title bar color Lazarus / VB Net, etc). Or change your system color when form loading using SetSysColor (search SetSysColor pinvoke), or use getHDC, releaseHDC functions from user32.dll.

But, for me, I more like doing like the sample below (form template).

Code:
if mainform then mainform.destroy() end

--# Color using MS Access Color Code : https://endprod.com/colors/
color = {}
color.DarkGrey = 3684408
color.Black = 0
color.LightGrey = 5855577
color.White = 16775408
color.DarkOrange = 36095
color.DodgerBlue = 16748574

--# Main Form Icon
local pic = createPicture()
pic.loadFromStream(findTableFile('icon_standard.png').Stream)

--# Main Form Design
mainform = createForm()
mainform.setSize(400,400)
mainform.Position = 'poScreenCenter'
mainform.BorderStyle = 'bsNone'
mainform.Color = color.DarkGrey
mainform.ShowInTackBar = 'stAlways'
mainform.Icon = pic.getBitmap()
mainform.WindowState = 'wsNormal'
mainform.OnMouseDown = function() mainform.DragNow() end

--# Title Bar
titlebar = createPanel(mainform)
titlebar.setPosition(0,0)
titlebar.setSize(mainform.Width, 40)
titlebar.BorderStyle = 'bsNone'
titlebar.BevelInner = 'bsNone'
titlebar.BevelOuter = 'bsNone'
titlebar.Color = color.Black
titlebar.Anchors = '[akTop,akLeft,akRight]'
titlebar.OnMouseDown = function() mainform.DragNow() end

--# Title Bar Components
formIcon = createImage(titlebar)
formIcon.setSize(25,25)
formIcon.setPosition(8,8)
formIcon.Stretch = true
formIcon.Picture.loadFromStream(findTableFile('icon_standard.png').Stream)

labelTitleBar = createLabel(titlebar)
labelTitleBar.Font.Name = 'Tahoma'
labelTitleBar.Font.Size = 11
labelTitleBar.Font.Color = color.DarkOrange
labelTitleBar.setPosition(formIcon.Left + formIcon.Width + 5,10)
labelTitleBar.Caption = 'My Trainer'

minimizeIcon = createImage(titlebar)
minimizeIcon.setSize(30,30)
minimizeIcon.setPosition(305,5)
minimizeIcon.Stretch = true
minimizeIcon.Picture.loadFromStream(findTableFile('minimize_icon.png').Stream)
minimizeIcon.Anchors = '[akTop,akRight]'
minimizeIcon.Cursor = -21


maximizeIcon = createImage(titlebar)
maximizeIcon.setSize(30,30)
maximizeIcon.setPosition(minimizeIcon.Left + minimizeIcon.Width + 1,5)
maximizeIcon.Stretch = true
maximizeIcon.Picture.loadFromStream(findTableFile('icon_maximize.png').Stream)
maximizeIcon.Anchors = '[akTop,akRight]'
maximizeIcon.Cursor = -21

exitIcon = createImage(titlebar)
exitIcon.setSize(30,30)
exitIcon.setPosition(maximizeIcon.Left + maximizeIcon.Width + 1,5)
exitIcon.Stretch = true
exitIcon.Picture.loadFromStream(findTableFile('exit_icon.png').Stream)
exitIcon.Anchors = '[akTop,akRight]'
exitIcon.Cursor = -21

--# Main Form Event Handler Functions
function formMinimize()
 mainform.WindowState = 'wsMinimized'
end

function formMaximize()
 if mainform.WindowState  == 'wsNormal' then
    mainform.WindowState = 'wsMaximized'
 else
    mainform.WindowState = 'wsNormal'
 end
end

function formExit()
 closeCE()
 return caFree
end

minimizeIcon.OnClick = formMinimize
maximizeIcon.OnClick = formMaximize
exitIcon.OnClick = formExit


Note: For icons images, need provide by yourself.



Capture.JPG
 Description:
 Filesize:  12.77 KB
 Viewed:  1670 Time(s)

Capture.JPG



_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites