rickywaive Posted November 8, 2010 Share Posted November 8, 2010 Hi, 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. WinActivate($Application_Main_Title) Sleep(200) 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 Case $BST_CHECKED MsgBox(0, "Test", "Button is checked. " & $test) Case $BST_INDETERMINATE MsgBox(0, "Test", "Button is grayed " & $test) Case $BST_UNCHECKED MsgBox(0, "Test", "Button is cleared " & $test) case Else MsgBox(0, "Test", "nothing") EndSwitch MsgBox(0, "Text", $text) above pops-up 2 boxes...first always falls into "Button is cleared "...second is a blank box. thanks, ricky Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 8, 2010 Share Posted November 8, 2010 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: Select Case BitAND($test, $BST_CHECKED) MsgBox(0, "Test", "Button is checked. " & $test) EndSelect 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 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