Jump to content

Big Question


Recommended Posts

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...