Sign in to follow this  
Followers 0
Madza91

Get Default Control's Edge Color...

5 posts in this topic

Hello, is possible to get Window's default color of some control's edge (for ex. color of Edit's edge) ?!


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites



Hello, is possible to get Window's default color of some control's edge (for ex. color of Edit's edge) ?!

Something like this (very ugly, but work):

$GUI = GUICreate("EXAMPLE",200,200,-1,-1)
$EDIT = GUICtrlCreateEdit("TEST",5,5,190,190)
GUISetState()

While 1
    $MSG = GUIGetMsg()
    If $MSG = -3 Then 
        Exit
    EndIf
    $POS = ControlGetPos("EXAMPLE","",$EDIT)
    TrayTip("CONTROL EDGE COLOR",Hex(PixelGetColor($POS[0],$POS[1],$GUI),6),1)
    Sleep(30)
WEnd

When the words fail... music speaks

Share this post


Link to post
Share on other sites

Or maybe with _WinAPI_GetSysColor().


When the words fail... music speaks

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Maybe, but with what $iIndex? I tried almost whole $iIndex's from Help file, and I'm not founded right one ;0

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites

Maybe, but with what $iIndex? I tried almost whole $iIndex's from Help file, and I'm not founded right one ;0

Example:

#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

GUICreate("My GUI", 200, 100)
GUISetBkColor(0xFFFFFF)

$BGR = _WinAPI_GetSysColor($COLOR_ACTIVEBORDER) ;Get the active border color

GUICtrlCreateLabel("", 50, 35, 100, 20)
GUICtrlSetBkColor(-1, _RGB2BGR($BGR)) ;Set gived color to a label control

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd

Func _RGB2BGR($iColor)
    Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF)
EndFunc   ;==>_RGB2BGR()

:)

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  
Followers 0