hi all,
i am writing a script where the script woud keep testing for the condition of the checkbox, perform a task when checkbox is CHECKED and vice versa. the problem i have encountered is that i have to CLICK on the checkbox for it to test for the condition of the checkbox. How can i make it so it will keep automatically check for the condition of the checkbox without the user clicking on it?
my code is listed below,
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <TreeViewConstants.au3>
_Main()
Func _Main()
Local $hGUI,$msg,$box1info
Local $box1
; Create GUI
$hGUI = GUICreate("checkbox test", 150, 100)
GUISetState()
GuiCtrlCreateGroup("checkbox", 5, 5)
$box1 = GUICtrlCreateCheckbox("checkbox1", 20, 60, 100)
Do
$msg = GUIGetMsg()
Select
case $msg = $box1
$box1info = guictrlread($box1)
if $box1info = $GUI_CHECKED then
run("notepad")
sleep(500)
send("x")
elseif $box1info = $GUI_UNCHECKED then
run("notepad")
sleep(500)
send(y)
endif
EndSelect
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Endfunc