Jump to content
Sign in to follow this  


Recommended Posts


Unfortunately I can not test in different themes, because I have only Windows XP theme (Default). I would appreciate if somebody will test this function in other themes.


func _GetTabBkColor($hWnd)
    local $hTheme, $Ret
    if not IsHWnd($hWnd) then
        $hWnd = GUICtrlGetHandle($hWnd)
    $hTheme = DllCall('uxTheme.dll', 'ptr', 'OpenThemeData', 'hwnd', $hWnd, 'wstr', 'TAB')
    $Ret = DllCall('uxTheme.dll', 'lresult', 'GetThemeColor', 'ptr', $hTheme[0], 'int', 9, 'int', 0, 'int', 0x0EED, 'dword*', 0)
    if (@error) or ($Ret[0] < 0) then
        $Ret = -1
    DllCall('uxTheme.dll', 'lresult', 'CloseThemeData', 'ptr', $hTheme[0])
    if $Ret = -1 then
        return SetError(1, 0, -1)
    return BitAND($Ret[5], 0x00FF00) + BitShift(BitAND($Ret[5], 0x0000FF), -16) + BitShift(BitAND($Ret[5], 0xFF0000), 16)
endfunc; _GetTabBkColor
Edited by Yashied

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