Jump to content

get ClassNameNN or Control ID under mouse


Recommended Posts

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

Link to comment
Share on other sites

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