Jump to content

Need Help with mouseclick


Recommended Posts

OK. I have a problem trying to get user input from an external program. I am trying to find when a user selects a button. I need to get this input and pass it in my autoit script within in a If Then Else. I have read, but to no avail. I am assuming that a ControlGetFocus might do the trick? Any Ideas??

Link to comment
Share on other sites

OK.  I have a problem trying to get user input from an external program.  I am trying to find when a user selects a button.  I need to get this input and pass it in my autoit script within in a If Then Else.  I have read, but to no avail.  I am assuming that a ControlGetFocus might do the trick?  Any Ideas??

<{POST_SNAPBACK}>

You need to put your test condition in a loop, i.e.:

while $id <> $desired_control_id
  $id = ControlGetFocus("name or variable of desired window")
  sleep(1); necessary for cpu util issues
Wend

now you know that the control is active

so you can do stuff

if you need to test multiple controls, use a while loop and then call functions for your hits based off of a select / case / end select group.... I find this to be easier to debug than a big bunch of nested if /else blocks.

Don't be afraid to try simple test cases that can answer your own question in a matter of seconds....

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

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...