Jump to content
Sign in to follow this  

Finding Co-ordinates for Windows

Recommended Posts


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

$x_current= $location[0]
$y_current= $location[1]
$button_x = $x_current
$button_y = $y_current
Until 1=2

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

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

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!")
$win_pos= WinGetPos($title)
$x = $win_pos[0]
$y= $win_pos[1]
$x_current= $location[0]
$y_current= $location[1]
$button_x = $x_current - $x
$button_y = $y_current - $y
Until 1 = 2

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

Hope this helps anyone.


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.