How to Display Mouse Coordinates

By William Garmany

Issue a set of commands to display the mouse coordinates in your Microsoft Windows computer. If you want to be able to check your coordinates often, then your best bet is to write a Windows script that you can run anytime you need to run your check. Creating a script in Microsoft Windows is simple. Once you have made the script, place it on your desktop for easy access and click on it to start tracking the coordinates.

Step 1

Click "Start" then navigate through "Programs" and "Accessories." Click "Notepad" to open Notepad on your computer.

Step 2

Type the following script into Notepad:dim addx as unsigneddim addy as unsignedaddx=allocate(8)addy=addx+4repeata=External("user32.dll","GetCursorPos",addx)if a <>0 thenpos_x=PeekInteger(addx,4)pos_y=PeekInteger(addy,4)mes$="Cursor X is at : "+str$(pos_x)+"\n\Cursor Y is at : "+str$(pos_y)msgframe(mes$,1)pause 1endifuntil i=100This will display the mouse coordinates for the next 100 seconds. Adjust this time by changing the value in the last line of the script from "100" to another number of your choice.

Step 3

Save the file as "mouse.js" on your desktop. File extension "*.js" is how Microsoft Windows recognizes it as a script to run with the default scripting program.

Step 4

Double-click the file to run the script. The results will be displayed in a window that will open up.