Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Sub WhereAmI()
Dim pTargetPoint As POINTAPI
Dim lRetVal As Long
lRetVal = GetCursorPos(pTargetPoint)
MsgBox "My Position:" & vbLf & pTargetPoint.x & "," & pTargetPoint.y
End Sub