Jump to content
Sign in to follow this  
AutoAl

Finding Co-ordinates for Windows

Recommended Posts

AutoAl

Hi All,

I created 2 little scripts which finds the Co-ordinates which could help with

MouseMove, MouseClick, ControlClick

The first script I found is most useful for MouseMove/Click.

(Take into consideration that the first script I am showing you looks at the Co-ordinates for your screen resolution)

--------------- First Script ---------------

Do
$location=MouseGetPos()
$x_current= $location[0]
$y_current= $location[1]
$button_x = $x_current
$button_y = $y_current
ToolTip($button_x&","&$button_y)
Until 1=2

--------------- End Script ---------------

The next script looks for Co-ordinates in the specified Window that you provide using

InputBox
I found this script is extremelly useful for ControlClicks!

--------------- Last Script ---------------

$title=InputBox("Enter Window Title","Type the specific window title you want to find Co-ords for. DO NOT LEAVE THIS BLANK OR YOU WILL GET FALSE CO-ORDINATES!")
Do
$win_pos= WinGetPos($title)
$x = $win_pos[0]
$y= $win_pos[1]
$location=MouseGetPos()
$x_current= $location[0]
$y_current= $location[1]
$button_x = $x_current - $x
$button_y = $y_current - $y
ToolTip($button_x&','&$button_y)
Until 1 = 2

--------------- End of Scripts ---------------

Hope this helps anyone.

Al.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.