|
-
Nov 17th, 1999, 11:20 PM
#4
Hyperactive Member
GetCursorPos Function
Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINT_TYPE) As Long
GetCursorPos reads the current position of the mouse cursor. The x and y coordinates of the cursor (relative to the screen) are put into the variable passed as lpPoint. The function returns 0 if an error occured or 1 if it is successful.
lpPoint
Receives the x and y coordinates of the mouse cursor.
Example:
' Display the coordinates of the mouse cursor
Dim coord As POINT_TYPE ' receives coordinates of cursor
Dim retval As Long ' return value
retval = GetCursorPos(coord) ' read cursor location
Debug.Print "The mouse is at:"; coord.x; coord.y
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|