Jump to content
Sign in to follow this  
Vieri

get active window's object properties according to mouse position

Recommended Posts

Vieri

Hi!

How can I get the properties of an object that's beneath the mouse cursor?

Suppose that an autoit script running in background has HotKeySet triggering a user function when the shift key is pressed.

What I would like to do is have the user function get the attributes of the object (if any) found beneath

the mouse cursor (eg. if the cursor is on a text button, get the object ID, name and caption and save this data to a file).

What's the simplest way of doing this?

I could get the mouse coordinates (MouseGetPos) and the current active window

(I suppose I could combine WinActive and WinList to determine the active window or simply WinGetHandle("[ACTIVE]") ?)

but I don't know how to get an object's attributes at a given x,y position (a bit like what the "control" tab displays in the Autoit "window info" application).

Help greatly appreciated.

Share this post


Link to post
Share on other sites
FireLord

How can I get the properties of an object that's beneath the mouse cursor?

AutoIt Window Info can do it for you.

EDIT: Sorry, skipped where you mentioned it.

Edited by FireLord

[center]See the Helpfile[/center]
While Alive()
	 DrinkWine();
}
[center][/center]

Share this post


Link to post
Share on other sites
Vieri

Take a look here. It might help :P

Yes it does. Thanks.

Unfortunately, there are many cases in which elements are not discernable. For instance, even Au3Info.exe doesn't detect more information than MozillaWindowClass1 from, say, Firefox. Also, from the "About Mozilla Firefox" window, I have not been able to retrieve, eg, the "credits" string from the homonymous button, etc.

Also, I didn't manage to retrieve tooltip text (hidden text?) from any aplication.

Are there functions other than ControlGetText for this purpose? (apart from StatusbarGetText)

In the above example regarding Firefox, how could I get, for example, the string within the URL edit box or the name of the "go to URL..." button or the tooltip text that comes up when one hovers the mouse over this button or the "File"/"Edit"/"Tools"... strings when you click the main menu options, etc.

Is this currently possible with AutoIT?

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  

×