How to Display Mouse Coordinates

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

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.

Advertisement

Step 1

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

Video of the Day

Step 2

Type the following script into Notepad:

Advertisement

dim addx as unsigned dim addy as unsigned addx=allocate(8) addy=addx+4 repeat a=External("user32.dll","GetCursorPos",addx) if a <>0 then pos_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 1 endif until i=100

Advertisement

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

Advertisement

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.

Video of the Day

Advertisement

Advertisement

references