Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Detecting if checkbox is checked fails but why ?

$
0
0

Well a program, has a popup screen and in the past i used that to set some checkboxes.
However now i need to check if it is still checked.

So i took AutoIt v3 Window info tool , and this is what i got for my checkbox :


Class => Button
Instance => 2
ClassnameNN => Button2
Name =>
Advanced Mode => [CLASS:Button; INSTANCE:2]
ID => 403

 

Then i used below code to check it, and just for testing my code i use a beep
 

;this is the moment i wait for the launch the Preference window.

$mywindow2 = WinWait("Preferences")

; till above my code works fine as i used the same code to set those checkboxes in the past
if GUICtrlRead("[CLASS:Button; INSTANCE:2]",0) =  $GUI_CHECKED Then beep(6000,500)

 

I never here the test Beep and the error i get from above code is :
 

if GUICtrlRead("[CLASS:Button; INSTANCE:2]",0) =  $GUI_CHECKED Then beep(6000,500)
if GUICtrlRead("[CLASS:Button; INSTANCE:2]",0) =  ^ ERROR

 

Although people use it a lot $GUI_CHECKED it doesnt work for me ?, neither does simple 1 or 0 or some exotic Bitand function i saw elsewhere
What do i wrong ? there are multiple checkboxes on the form, and i need to check several of them


Viewing all articles
Browse latest Browse all 12506

Trending Articles