Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get mouse coordinates

Status
Not open for further replies.

forecasting

Programmer
May 2, 2002
130
Does anyone know how to get the screen coordinates of the mouse with vbscript? I tried "window.event.screenX", but get an error message telling me "Object required: window.event
 
Are you doing this as a stand alone VBScript, or within a webpage?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I found a method to work.

<BODY onmousemove="window.name = window.event.x + '|' + window.event.y">

My vbscript then gets the value in "window.name" when it traps a double_click event. Is there any reason, however, that "window.name" is a bad place to store this value? If that is so, is there a better place to store it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top