James Posted November 14, 2007 Share Posted November 14, 2007 (edited) Hey all, If I was to have a label as a block. How could I automatically change the colour of it to the themes default colour? I tried, DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)oÝ÷ Ø.qǬ±8ZK jg¬lGb´kç]¢)àjëh×6GUICtrlSetBkColor($colorblox, DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)) But it came out black from the Royale Blue theme. Edited November 14, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Valuater Posted November 14, 2007 Share Posted November 14, 2007 if the GUI uses the themes default color, just set the label as transparent 8) Link to comment Share on other sites More sharing options...
James Posted November 14, 2007 Author Share Posted November 14, 2007 (edited) Good idea, I will try that now.Edit: I mean that if the user is using Windows XP Default Blue theme, it will use the default blue color. and if they use the Silver it will be a silver block. Edited November 14, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 14, 2007 Moderators Share Posted November 14, 2007 I tried, GUICtrlSetBkColor($colorblox, DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0))oÝ÷ Ø×ê.µ¹ZrGë¢kay2jWçéßÛßêº^NßÛºyòß}÷ßrÞ¶g²L¨¹ª®zËb¢|!j×hzÆ®¶sd×6t&÷cBÂgV÷C´GVgV÷C²ÂgV÷C³gV÷C²fײWFÆÄ6ÆÂgV÷C·WFVÖRæFÆÂgV÷C²ÂgV÷C¶æöæRgV÷C²ÂgV÷Cµ6WEFVÖT&÷W'FW2gV÷C²ÂgV÷C¶çBgV÷C²ÂÂb Give you? Once you answer that, what does that color translate too? (Although!! It did change the msgbox's default theme... which I thought was cool). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
James Posted November 14, 2007 Author Share Posted November 14, 2007 Haha, Smoke that's cool! I didn't think of that. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Siao Posted November 14, 2007 Share Posted November 14, 2007 (edited) I don't get the question at all. The label is already using default color of current theme, unless you specify another color with GuiCtrlSetBkColor. Edited November 14, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
James Posted November 15, 2007 Author Share Posted November 15, 2007 Take a look at this, MCL. When you run it, you will notice there is a box which you can move the window around with. If you are using Windows XP default it will be blue otherwise it will change colour depending on what the default theme colour is. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Siao Posted November 15, 2007 Share Posted November 15, 2007 That's active/inactive titlebar color. #include <GuiConstants.au3> ;~ Global Const $WM_ACTIVATE = 0x6 Global Const $COLOR_ACTIVECAPTION = 2 Global Const $COLOR_INACTIVECAPTION = 3 $hGui = GUICreate("Color...", 200, 200, -1, -1, -1, $WS_EX_TOPMOST) GUIRegisterMsg($WM_ACTIVATE, "On_WM_ACTIVATE") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func On_WM_ACTIVATE($hWnd, $Msg, $wParam, $lParam) Local $iColorIndex, $aRet If $wParam Then $iColorIndex = $COLOR_ACTIVECAPTION Else $iColorIndex = $COLOR_INACTIVECAPTION EndIf $aRet = DllCall('user32.dll', 'int', 'GetSysColor', 'int', $iColorIndex) GUISetBkColor(RGB2BGR($aRet[0])) Return $GUI_RUNDEFMSG EndFunc Func RGB2BGR($iColor) Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF) EndFunc "be smart, drink your wine" Link to comment Share on other sites More sharing options...
James Posted November 16, 2007 Author Share Posted November 16, 2007 (edited) So it is. Is there anyway in which to get that colour in a box?.. I think it's in that code there ^-^ - Haha, I forgot to uncomment the $WM_ACTIVATE bit Thanks Siao Edited November 16, 2007 by JamesB Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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