Jump to content
Sign in to follow this  
kiwikid

Control Handle or Control ID

Recommended Posts

kiwikid

The application I'm working on imports in test procedures, and then spits them back out to the tester to record each step one at a time. While the recorder I've written does work for capturing key strokes, mouse clicks, and what have you, it's not entirely perfect. Although it plays back the test procedure as requested, I'd like to make it a little more exact. Since the recorder isn't going to have access to the AutoIt Window, how can I figure out the control handle or Control ID of a control based off from a click on the control or the typing of some text within the control? Having the ability to determine if the control has focus before continuing on with the test is important to ensure each step in the step procedure is completed. Thanks for the help in advance.

Share this post


Link to post
Share on other sites
PaulIA

The application I'm working on imports in test procedures, and then spits them back out to the tester to record each step one at a time. While the recorder I've written does work for capturing key strokes, mouse clicks, and what have you, it's not entirely perfect. Although it plays back the test procedure as requested, I'd like to make it a little more exact. Since the recorder isn't going to have access to the AutoIt Window, how can I figure out the control handle or Control ID of a control based off from a click on the control or the typing of some text within the control? Having the ability to determine if the control has focus before continuing on with the test is important to ensure each step in the step procedure is completed. Thanks for the help in advance.

Assuming that you don't want to have to specify Title/Text for the AutoIt functions:

To get the window under the cursor, use the WindowFromPoint API call. To get the control that has the focus, use the GetFocus API call.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
kiwikid

Assuming that you don't want to have to specify Title/Text for the AutoIt functions:

To get the window under the cursor, use the WindowFromPoint API call. To get the control that has the focus, use the GetFocus API call.

Paul,

I ended up finding that a call to the function GetDlgCtrlID was more of what I needed. Thanks for steering me in the right direction.

~Chris

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.