添加TIMER控件,INTERVAL设置成500即可
代码如下:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Timer1_Timer()
Dim p As POINTAPI
GetCursorPos p
Debug.Print "x=" & p.x & ", y=" & p.y
End Sub
评论