kevin24 0 Posted July 3, 2011 I created the Gui for purpose to auto click mouse n times with n is user input but when my user input the n value, if they do not switch to the main window soon enough the mouse will move not correct position. i wonder if there is any command that help me when m press the button on my Gui then my Gui will auto switch to the main window before do the mouse click Share this post Link to post Share on other sites
monoscout999 10 Posted July 3, 2011 this. winactivate($YourMainGUI) Share this post Link to post Share on other sites
kevin24 0 Posted July 3, 2011 do we have any command that can check number on screen? for example: my Gui will interact with window A. My Gui will click on 1 point of Window A and window A will create a random number from 1 to 6, if i want my Gui stop when Window A create number 6. how can i do? Share this post Link to post Share on other sites
monoscout999 10 Posted July 3, 2011 This is a way to do it. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> global $WindowCount = 0 $hGUI = GUICreate("test", -1, -1) GUIRegisterMsg($WM_CREATE,"WM_CREATE") $button = Guictrlcreatebutton("Click me",20,20,150,60) GUISetState(@SW_SHOW) $hGUI2 = GUICreate("test", 400, 400,10,10) GUISetState(@SW_SHOW) $hGUI3 = GUICreate("test", 400, 400,10,410) GUISetState(@SW_SHOW) Guictrlcreatebutton("only for test",14,145,151,15) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $button consolewrite($WindowCount&@CRLF) EndSwitch WEnd func WM_CREATE($hWndGUI, $MsgID, $WParam, $LParam) $WindowCount += 1 EndFunc Share this post Link to post Share on other sites