SkellySoul Posted December 21, 2009 Share Posted December 21, 2009 (edited) Hello Everyone I would like to start off by saying I really am bad with dll calling So I found this great script it changes controls in a GUI to the windows classic theme allowing you to paint controls that the XP theme doesn't allow. Func XPStyle($OnOff = 1) If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc ;==>XPStyle It works great but what I am looking for is to change the title bar of a GUI a long with scroll bars and and everything else and I know it can be done and I think it can be done with this call SetSysColors. If someone can please show me how to change the title bars color I think ill be set. I found some very good info but don't know how to use it. http://allapi.mentalis.org/tips/tip8.shtml http://msdn.microsoft.com/en-us/library/ms724940%28VS.85%29.aspx http://support.microsoft.com/kb/186062 I am still attempting to get it working but some help from experts would be really nice Edited December 21, 2009 by SkellySoul Link to comment Share on other sites More sharing options...
KaFu Posted December 21, 2009 Share Posted December 21, 2009 (edited) In the standard UDFs there is a function called _WinAPI_SetSysColors(). Edited December 21, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
SkellySoul Posted December 21, 2009 Author Share Posted December 21, 2009 In the standard UDFs there is a function called _WinAPI_SetSysColors().I honestly don't know how that one got by me but isn't there a way to set it for only one window that being the GUI it's self.Thanks very much for helping that quickly and have a happy holidays Link to comment Share on other sites More sharing options...
KaFu Posted December 21, 2009 Share Posted December 21, 2009 (edited) Looking at the function and the msdn link you provided above I dont see a hwnd, so I guess it just can be set systemwide. For sure it can be done per window, but that requires more something like a custom wm_paint or a custom window class... to complicated I even start to search for examples ... maybe just do it as done in the example in the UDF, apply your settings => GuiSetState() => re-apply old standard values. Edit: Merry Christmas (or happy holidays) to you too! Edited December 21, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
SkellySoul Posted December 21, 2009 Author Share Posted December 21, 2009 (edited) Looking at the function and the msdn link you provided above I dont see a hwnd, so I guess it just can be set systemwide. For sure it can be done per window, but that requires more something like a custom wm_paint or a custom window class... to complicated I even start to search for examples ... maybe just do it as done in the example in the UDF, apply your settings => GuiSetState() => re-apply old standard values. Edit: Merry Christmas (or happy holidays) to you too! ok, ill keep looking around and thanks very much again for the help and if you or anyone can find anything please let me know. [Edit] I am just adding this as a tip to remind me for later. To change title bar color you must not use windows xp theme must be classic to change title bars color. expandcollapse popup#include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _Test() Func _Test() $Test = $COLOR_ACTIVECAPTION _XP_Style(1) GUICreate("My GUI", 300, 200) _XP_Style(0) $Save = _WinAPI_GetSysColor($Test) _WinAPI_SetSysColors($Test , 255) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() _WinAPI_SetSysColors($Test, $Save) Exit EndFunc Func _XP_Style($OnOff = 1) $XS_n = "" If $OnOff And StringInStr(@OSTYPE, "WIN32_NT") Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf StringInStr(@OSTYPE, "WIN32_NT") And IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc Edited December 21, 2009 by SkellySoul Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now