Sign in to follow this  
Followers 0
gsprout

Finding Pixel Coordinates

5 posts in this topic

HI.

I haven't used AutoIT for several years... it use to be that you would get the location of the cursor, relative to the target window, when you used the Window Spy program, now called Autowindow. However, the coordinates of the cursor which are displayed now see to be relative to my whole desktop. Is there an easy or quick way to get the location of the cursor relative to the target window? My apologies in advance as I realize this has probably been addressed dozens of times but I could not find a search function on these forums.

-G

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Opt("MouseCoordMode", 0)        ;1=absolute, 0=relative, 2=client

While 1
    Sleep(10)
    $xy = MouseGetPos()
    ToolTip("X: "&$xy[0]&@CRLF&"Y: "&$xy[1])
WEnd
Relative to the active window.

Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites

Now I'm really confused. If I am trying to get the mouse coordinates relative tothe target window using Au3Info.exe ... how would I use that piece of code?

-G

Share this post


Link to post
Share on other sites

In the Windows Info Tool look into options along the top and be amazed at what you find.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Ah... dang... this software has improved immeasurably since I last used it! Thanks.

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