Sign in to follow this  
Followers 0

_GUICtrlButton_Get... returning 0

2 posts in this topic


I'm trying to return a non-AuotIT GUI application check box value, and continue to return 0 (error). Is there some other way to check the value of the check box? I can use ControlClick() function to successful check/uncheck the box everytime, but want to check the value of this check box before proceeding. Any help is appreciated, and the snipit of test code is below.



Local $FWBox_Handle = ControlGetHandle($Application_Main_Title, "", "[CLASS:gdkWindowChild; INSTANCE:14]")

Local $test = _GUICtrlButton_GetState($FWBox_Handle)

Local $text = _GUICtrlButton_GetText($FWBox_Handle)

Switch $test


MsgBox(0, "Test", "Button is checked. " & $test)


MsgBox(0, "Test", "Button is grayed " & $test)


MsgBox(0, "Test", "Button is cleared " & $test)

case Else

MsgBox(0, "Test", "nothing")


MsgBox(0, "Text", $text)

above pops-up 2 boxes...first always falls into "Button is cleared "...second is a blank box.



Share this post

Link to post
Share on other sites

The state of a control is a collection of bit values and more than one can be set at the same time (i.e. Checked + Enabled + Visible). You need to mask to the one you want to test:

    Case BitAND($test, $BST_CHECKED)
        MsgBox(0, "Test", "Button is checked. " & $test)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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