AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mouse position

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
playfullscientist



Joined: 20 Apr 2005
Posts: 22
Location: Princeton NJ USA

PostPosted: Wed Apr 20, 2005 9:37 pm    Post subject: mouse position Reply with quote

Hi...I tried this program to get the position of the mouse on the screen. But I only get the position of the mouse inside the OK button in the MsgBox. How do I get the position of the mouse anywhere on the screen? Thanks. Playfullscientist

#x::
Run,www.google.com
Loop
{
MouseGetPos,xpos,ypos,google
SetTimer,WatchCursor,100
MsgBox,4096,X%xpos%,Y%ypos%,zzz,zzz
}
return

WatchCursor:
MouseGetPos, , , id, control
return
_________________
I am a playful scientist
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Apr 20, 2005 9:52 pm    Post subject: Reply with quote

Hmm, capturing mouse coords relative to the whole screen? CoordMode?:
Code:
#Persistent
CoordMode, Mouse, Screen
SetTimer, WatchMouse
WatchMouse:
MouseGetPos, varX, varY
MsgBox, X: %varX%`nY: %varY%

_________________

Back to top
View user's profile Send private message Visit poster's website
Invalid User



Joined: 14 Feb 2005
Posts: 442
Location: Texas, Usa

PostPosted: Wed Apr 20, 2005 9:59 pm    Post subject: Reply with quote

See: http://www.autohotkey.com/forum/viewtopic.php?t=3234
_________________
my lame sig Smile
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Wingfat



Joined: 23 Aug 2004
Posts: 193
Location: East Bay, California USA

PostPosted: Wed Apr 20, 2005 10:34 pm    Post subject: Reply with quote

Code:

MouseGetPos, xpos, ypos
; Msgbox, The cursor is at X%xpos% Y%ypos%.
; Msgbox not needed so it is commented out.

; This example allows you to move the mouse around to see
; the mouse pos:
#Persistent
SetTimer, WatchCursor, 100
return

WatchCursor:

MouseGetPos, xpos, ypos,
ToolTip, x%xpos% Y%ypos%
return

This will show on the tool tip menu where your mouse is, so you dont need a msg box. you can remove the comment infront of the msg box to add it back in.
_________________
----------------------------
Wingfool you fat! I mean, Wingfat you fool!
Line from Woody Allen's movie "What's Up Tiger Lilly?"
-----------------------------
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group