Private Type POINTAPI
x As Long
y As Long
End Type
'カーソルの現在のスクリーン座標の取得
Private Declare Function GetCursorPos Lib "user32.dll" _
(lpPoint As POINTAPI) As Long
Private Sub Form_Load()
Me.Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
Dim lpPoint As POINTAPI
Call GetCursorPos(lpPoint)
Me.Label3(0).Caption = lpPoint.x
Me.Label3(1).Caption = lpPoint.y
End Sub