Jump to content

Control Handle or Control ID


Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

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