Jump to content

Recommended Posts

Posted

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?

  • Developers
Posted

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

Posted

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.

Posted

LOL describing a programming problem in text is (almost) always ambiguous

Example: your question just makes me think you should read the example

given in the help file for "GUICtrlCreateButton" ...

HTH,

whim

  • Developers
Posted

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

Posted

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

The 2 button window is not created by au3 but of a regular program.

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
×
×
  • Create New...