Sign in to follow this  
Followers 0
improbability_paradox

get ClassNameNN or Control ID under mouse

6 posts in this topic

Hi there. I am new to this forum, but have been using AutoIT for about a year now. I am currently working on a script, and would like to know if there is any way that I can get the ClassNameNN or Control ID of the control currently under the mouse (same info that I would get with AU3INFO, but from within the script itself). I have looked through the help file extensively, and searched this forum as well, but I couldn't really find anything that related to what I want to accomplish. Any ideas, anyone? thanks in advance.

Regards,

Improbability

Share this post


Link to post
Share on other sites



Would this work for you?

_CtrlGetByPos

That may just do it! I will test it out and let you know.

Share this post


Link to post
Share on other sites

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

That may just do it! I will test it out and let you know.

Sounds good (and welcome to the forum!) :whistle:

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

After a bit of testing/troubleshooting, this worked perfectly for me. It is basically the same code used in _CtrlGetByPos (also by smOke_N) but with a few changes and already set up to work with the mouse coordinates. the only thing I had to change in the function itself was the line

Local $hWin = WinGetHandle(''), $hCtrlWnd = '', $sClassList = WinGetClassList($hWin)

which became

Local $hWin = WinGetHandle("active"), $hCtrlWnd = '', $sClassList = WinGetClassList($hWin)

and was really only necessary because of my own code which came prior to the function being called. Awesome! thank you both for your replies!

Edited by improbability_paradox

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