Sign in to follow this  
Followers 0
nrogers64

When to Use ControlGetHandle?

2 posts in this topic

I'm new to AutoIt. Based on my experimenting, "ControlClick", "ControlSend", and "ControlSetText" all seem like very powerful functions. They can be used to interact with windows that aren't even in focus. That being the case, I'm not sure what the purpose of the "ControlGetHandle" function is. The reference page says that it "retrieves the internal handle of a control", but that description leaves me scratching my head. What can I do with the "ControlGetHandle" function that I can't do with the other functions? What purpose does it serve?

Thanks!

Share this post


Link to post
Share on other sites



The other Control.... functions all include the functionality of ControlGetHandle, but not all functions do. Take for instance the _GUICtrl.......... UDF's. They can be used on other programs, provided you supply a handle, and the control is of the same class.

Using ControlGetHandle and then using the handle in the other Control... functions is probably a bit more efficient when you use that control multiple times.

Using the handle will ensure you interact with the same control each time, even if there might be multiple matches based on title, text and controlID.

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