Returns the cursor position.
Private Type POINTAPI x As Long y As Long End Type Private Declare Function M_GetCursorPos Lib "user32" Alias "GetCursorPos" _ (lpPoint As POINTAPI) As Long Public Sub GetCursorPos(ByRef xX As Long, ByRef xY As Long) Dim pt As POINTAPI Call M_GetCursorPos(pt) xX = pt.x xY = pt.y End Sub
