Jump to content

automatic

Members
  • Posts

    2
  • Joined

  • Last visited

automatic's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. 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
  2. Hi all, i need help with creating a GUI window with 2 menu options. the challenge here is that i want the menu option page layout to be displayed as soon as the menu option is either highlighted with ALT or by a mouse click. $file = GuiCtrlCreateMenu("&1file") $tool = GuiCtrlCreateMenu("&2tool") GUISetState() Do $msg = GUIGetMsg() If $msg = $file Then MsgBox(0,"test","only testing....") EndIf if $msg = $tool then MsgBox(0,"tool test", only tool testing....") EndIf Until $msg = $GUI_EVENT_CLOSE so basically, i want the file msgbox to be displayed by two methods, 1)after i hit ALT (first menu option is selected by default), the file msgbox will be displayed. when i hit ALT+2 or right arrow key, the msgbox for tool will be displayed. 2)by mouse click on each menu option (file, tool, etc).
×
×
  • Create New...