Jump to content
Sign in to follow this  
James

Set a Label BkColor to the themes default colour

Recommended Posts

James

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 by JamesB

Share this post


Link to post
Share on other sites
Valuater

if the GUI uses the themes default color, just set the label as transparent

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
Siao

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 by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites
Siao

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"

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.