Vladi243 Posted July 25, 2008 Share Posted July 25, 2008 Hi 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 More sharing options...
TerarinKerowyn Posted July 25, 2008 Share Posted July 25, 2008 Will PixelGetColor ( x , y [, hwnd] ) help you out here? Contact via MSN: [email=terarink_msn@hotmail.com]terarink_msn@hotmail.com[/email], yahoo: terarink_yah Link to comment Share on other sites More sharing options...
Vladi243 Posted July 25, 2008 Author Share Posted July 25, 2008 I saw this function in the help file, but it's not effective because the GUI can be moved. Link to comment Share on other sites More sharing options...
ProgAndy Posted July 25, 2008 Share Posted July 25, 2008 If it's your button, just save the color to a 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 More sharing options...
Vladi243 Posted July 25, 2008 Author Share Posted July 25, 2008 If it's your button, just save the color to a variable I can't understand how it helps me to read the color of the button. The color always changes. Link to comment Share on other sites More sharing options...
billthecreator Posted July 25, 2008 Share Posted July 25, 2008 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 More sharing options...
TerarinKerowyn Posted July 25, 2008 Share Posted July 25, 2008 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 More sharing options...
Vladi243 Posted July 25, 2008 Author Share Posted July 25, 2008 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 buttonI 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 More sharing options...
Vladi243 Posted July 25, 2008 Author Share Posted July 25, 2008 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 buttonCan we see the code work I can better explain it to youSorry I can't show my code. Link to comment Share on other sites More sharing options...
ProgAndy Posted July 25, 2008 Share Posted July 25, 2008 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 More sharing options...
TerarinKerowyn Posted July 25, 2008 Share Posted July 25, 2008 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 More sharing options...
billthecreator Posted July 25, 2008 Share Posted July 25, 2008 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 More sharing options...
Vladi243 Posted July 25, 2008 Author Share Posted July 25, 2008 have it so when you click the button, it calls this function... Func: Func GuiCtrlGetColor() $a=GUIGetCursorInfo() $color = PixelGetColor($a[0],$a[1]) EndFuncIt's much better. Thanks to all who helped me Link to comment Share on other sites More sharing options...
weaponx Posted July 25, 2008 Share Posted July 25, 2008 I've had a request in for this for quite some time:http://svn.autoitscript.com/trac/ticket/119 Link to comment Share on other sites More sharing options...
Vladi243 Posted July 25, 2008 Author Share Posted July 25, 2008 I've had a request in for this for quite some time:http://svn.autoitscript.com/trac/ticket/119Good idea! 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