Jump to content

if control_executed check


 Share

Recommended Posts

Hello.

Here's the situation:

I have a window with a Cancel and OK buttons. I want the au3 to take action based on which of the 2 possibilities. Of course, I don't want to reroute action; the program carries on with its action and the au3 acts separately based on the same choice.

I've read in the help but couldn't find anything.

So, can a control (e.g. button) be checked for "executed" and return true / false?

Or, at least, is it possible to return the last control executed in a window?

I'd have as an alternative to check the xy coords of the mouse when clicked and have them compared to each of the bottons' coords. But I'd use this as a very last resort.

Any other ideas?

Link to comment
Share on other sites

  • Developers

Not fully sure what you are asking but if the question is if you can check the text on a button than yes.

Look in the helpfile for: ControlGetText ( "title", "text", controlID )

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Thanks for replying. My mistake - I was ambiguous. I reformulate:

I have a window with a Cancel and OK buttons. I want the au3 to take action based on which of the 2 buttons was pressed. So, if I press OK, the window closes and my au3 does something, it doesn't matter what; if I press Cancel, the window closes and my au3 does something else.

I know of the functions that return the text, position etc of the control and if it's hidden, active; I ask if there's a function that checks whether the control is executed.

It must be resonably achievable internally to AutoIt. Just like the event when a particular window is closed, a similar event when a button is pressed must exist.

Link to comment
Share on other sites

  • Developers

Thanks for replying. My mistake - I was ambiguous. I reformulate:

I have a window with a Cancel and OK buttons. I want the au3 to take action based on which of the 2 buttons was pressed. So, if I press OK, the window closes and my au3 does something, it doesn't matter what; if I press Cancel, the window closes and my au3 does something else.

I know of the functions that return the text, position etc of the control and if it's hidden, active; I ask if there's a function that checks whether the control is executed.

It must be resonably achievable internally to AutoIt. Just like the event when a particular window is closed, a similar event when a button is pressed must exist.

This window with the 2 buttons, is that your script or another program?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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