Sign in to follow this  
Followers 0
WestCBear

Capturing External Window Button Event

7 posts in this topic

#1 ·  Posted (edited)

Hi All,

 

This is a simple request. I just need someone to point me in the right direction with the following:

I need to capture a pressed button event on an external window.  For example, if a button is pressed in an external window, my AutoIT program will do something.

(Or is this way more complicated than I realize?)

Thanks!

WestCBear

Edited by WestCBear

Share this post


Link to post
Share on other sites



A window button or a keyboard button? Why do you need to capture an event for another program? What program are you trying to automate?

Share this post


Link to post
Share on other sites
1 hour ago, WestCBear said:

Or is this way more complicated than I realize?

It's not easy. There are more details needed, like:

  • OS
  • is Au3Info.exe able getting Infos about:
    • Window: hwnd or title, position
    • Control: ID, position relativ to window

 

Share this post


Link to post
Share on other sites
On ‎03‎/‎29‎/‎2016 at 6:26 PM, AutoBert said:

It's not easy. There are more details needed, like:

  • OS
  • is Au3Info.exe able getting Infos about:
    • Window: hwnd or title, position
    • Control: ID, position relativ to window

 

Hi AutoBert,

 

The OS is Windows 7

Au3Info.exe is able to get both the Window title and the control name of the button pressed.  I feel like there is simple function that will help, but I'm not sure which one.

 

WestCBear

Share this post


Link to post
Share on other sites

Something like this should help you(pseudo code):
If ExternalWindows exists(See WinExists() on help file) Then
While loop until you found if the button is pressed or clicked.
  - Find a way to know if the button is pressed (check if the button state change or button text change on click or action with Au3Info) .
  - Check if the external Windows do something or change something if that button is pressed is another way to detect if the button was clicked.
Do what you want to do.

Something like that should help.

In order to help more we need more info, code you already try, more info about the window or button, what is the button action what the external windows show or do on this button action.

Happy Coding

Kind Regards
Alien.
 

Share this post


Link to post
Share on other sites

You can do it more efficiently using a hook. Look at

Quote

_WinAPI_SetWinEventHook

In the help file. It's possible, and pretty easy to do.

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