'Get Cursor Position using GetCursorPos API
'Get Cursor Position using GetCursorPos API
API Declarations
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32.dll" (xyPoint As POINT_TYPE) As Long
Rate 'Get Cursor Position using GetCursorPos API
(1(1 Vote))
'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 5
End Sub
Private Sub Timer1_Timer()
Dim cp As POINT_TYPE
Dim rval As Long
rval = GetCursorPos(cp) ' Get cursor location
Label1.Caption = "The mouse is at X=" & cp.X & " Y=" & cp.Y
End Sub
'Get Cursor Position using GetCursorPos API Comments
No comments yet — be the first to post one!
Post a Comment