mike Posted January 12, 2009 Share Posted January 12, 2009 how to change the GUI color the same with the picture below with/or without Xskin ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 12, 2009 Moderators Share Posted January 12, 2009 @mike, Start by looking at the following in the help file: GUISetBkColor, GUICtrlSetBkColor and GUICtrlSetColor. Then you might like to look at _WinAPI_SetSysColors. If you run into trouble, post your code! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
mike Posted January 13, 2009 Author Share Posted January 13, 2009 thanks Melba... Link to comment Share on other sites More sharing options...
ss3vegeta Posted January 13, 2009 Share Posted January 13, 2009 (edited) I don't mean to hijack someone else's thread but this seams an appropriate question to follow up with. I'm got this code from the help file: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $aElements[2] = [$COLOR_ACTIVECAPTION, $COLOR_GRADIENTACTIVECAPTION] ; Red and Yellow Local $aColors[2] = [255, 65535], $aSaveColors[2] GUICreate("My GUI", 300, 200) $aSaveColors[0] = _WinAPI_GetSysColor($COLOR_ACTIVECAPTION) $aSaveColors[1] = _WinAPI_GetSysColor($COLOR_GRADIENTACTIVECAPTION) _WinAPI_SetSysColors($aElements, $aColors) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() _WinAPI_SetSysColors($aElements, $aSaveColors) Exit EndFunc ;==>_Main I guess I'm wondering if this will only work on XP when the theme is set to Classic? It works fine on classic but when I switch to the XP theme it doesn't work. Any advice? Thanks ss3 Edited January 13, 2009 by ss3vegeta Link to comment Share on other sites More sharing options...
martin Posted January 13, 2009 Share Posted January 13, 2009 I don't mean to hijack someone else's thread but this seams an appropriate question to follow up with. I'm got this code from the help file: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() Local $aElements[2] = [$COLOR_ACTIVECAPTION, $COLOR_GRADIENTACTIVECAPTION] ; Red and Yellow Local $aColors[2] = [255, 65535], $aSaveColors[2] GUICreate("My GUI", 300, 200) $aSaveColors[0] = _WinAPI_GetSysColor($COLOR_ACTIVECAPTION) $aSaveColors[1] = _WinAPI_GetSysColor($COLOR_GRADIENTACTIVECAPTION) _WinAPI_SetSysColors($aElements, $aColors) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() _WinAPI_SetSysColors($aElements, $aSaveColors) Exit EndFunc;==>_Main I guess I'm wondering if this will only work on XP when the theme is set to Classic? It works fine on classic but when I switch to the XP theme it doesn't work. Any advice? Thanks ss3With XP themes on Windows decides how thgings are done. You need to turn XP themes off before you create whatever you want to be different. expandcollapse popup#include <GuiConstants.au3> #include <windowsconstants.au3> Global $XS_n XPStyleToggle(1);turn xp themes off $Gui = GuiCreate("Test") GUISetBkColor(0xa9a9a8) XPStyleToggle(0);trun xp themes back on $RadioButton = GUICtrlCreateRadio("Text", 20, 40, 40) GUICtrlCreateGroup("group 1",10,60,300,200) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlCreateLabel("",20,70,300,50,$WS_CLIPSIBLINGS) GUICtrlSetBkColor(-1,0xffff00) ;GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState() GUISetBkColor(0xffff00) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func XPStyleToggle($OnOff = 1) If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0 If $OnOff Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
ss3vegeta Posted January 14, 2009 Share Posted January 14, 2009 With XP themes on Windows decides how thgings are done. You need to turn XP themes off before you create whatever you want to be different. #include <GuiConstants.au3> Global $XS_n Func XPStyleToggle($OnOff = 1) If Not StringInStr(@OSTYPE, "WIN32_NT") Then Return 0 If $OnOff Then $XS_n = DllCall("uxtheme.dll", "int", "GetThemeAppProperties") DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) Return 1 ElseIf IsArray($XS_n) Then DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", $XS_n[0]) $XS_n = "" Return 1 EndIf Return 0 EndFunc Thanks Martin! Great tip. I hope you don't mind but I've actually just incorporated your function into my program. 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