View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Position of the mouse pointer

Declare Function GetCursorPos Lib "user32" _
(lpPoint As POINTAPI) As Long


Type POINTAPI
X As Long
Y As Long
End Type


Sub ShowPos()
Dim lRetVal As Long
Dim Pos As POINTAPI
lRetVal = GetCursorPos(Pos)
MsgBox Pos.X & ", " & Pos.Y
End Sub


The mouse doesn't even need to be in the application window.


--
Gary''s Student


"Liam" wrote:

Hello all,

How would i get VB to report the position of the mouse pointer?

Thanks,
Liam :o)