Sign in to follow this  
Followers 0
mireazma

if control_executed check

6 posts in this topic

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?

Share this post


Link to post
Share on other sites



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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0