Jump to content

Read button color


Recommended Posts

Hi :P

I made that the button will change its color on click. Now I want to make a script that read the color of the button.

I search a lot in the help file, and didn't find any function that read the color of the button.

Can you help me with it?

Link to comment
Share on other sites

If it's your button, just save the color to a variable :P

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

when you click the button and it changes colors, also have it save to a variable, like above. like this:

$button = guictrlcreatebutton("", 20,20,20,20)
guictrlsetbkcolor(-1,"0xFF0000")

while 1
$nMsg = GUIGetMsg()
    Switch $nMsg
        Case $button
            $color = ;the color here
                        Guictrlsetbkcolor($button,$color)
    EndSwitch
wend

that way, you can call $color somewhere else, and thats the color of the button

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
Share on other sites

You should be able to link it directly to the control using PixelCoordMode linked up with the client and then you should be able to find the button

Can we see the code work I can better explain it to you

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

when you click the button and it changes colors, also have it save to a variable, like above. like this:

$button = guictrlcreatebutton("", 20,20,20,20)
guictrlsetbkcolor(-1,"0xFF0000")

while 1
$nMsg = GUIGetMsg()
    Switch $nMsg
        Case $button
            $color = ;the color here
                        Guictrlsetbkcolor($button,$color)
    EndSwitch
wend

that way, you can call $color somewhere else, and thats the color of the button

I know how to change the color.

I need a function that reads the current color of the button.

Link to comment
Share on other sites

You should be able to link it directly to the control using PixelCoordMode linked up with the client and then you should be able to find the button

Can we see the code work I can better explain it to you

Sorry I can't show my code.
Link to comment
Share on other sites

YOU have made a button. YOU made, that it changes it's color.

So, ON CHANGING the color SAVE it to a variable at this time, and when you want to know the color, READ the variable !!

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Then I cannot help you then if you won't show us your code. Anyways he is trying to find the color of the button aside from the color changing function. In other words they are two seperate functions and he doesn't want to carry the functions colorchange with it so he must find the color entirely, am I right? In other words you must use PixelGetColor but there is a way to follow the scroll or whatever makes the function move those making it impossible for us to help him out by not giving us the codework behind it all

Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah

Link to comment
Share on other sites

have it so when you click the button, it calls this function...

Func:

Func GuiCtrlGetColor()
    $a=GUIGetCursorInfo()
    $color = PixelGetColor($a[0],$a[1])
EndFunc

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...