这是源码! Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPI x As Long y As Long End Type Private Sub Timer1_Timer() Dim a As POINTAPI GetCursorPos a If a.x = 0 And a.y = 0 Then MsgBox "haha" End If End Sub
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPI x As Long y As Long End TypePrivate Sub Form_Click() Me.Cls End SubPrivate Sub Timer1_Timer() Dim a As POINTAPI GetCursorPos a Print a.x, a.y End Sub
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As LongPrivate Type POINTAPI
x As Long
y As Long
End Type
Private Sub Timer1_Timer()
Dim a As POINTAPI
GetCursorPos a
If a.x = 0 And a.y = 0 Then
MsgBox "haha"
End If
End Sub
x As Long
y As Long
End TypePrivate Sub Form_Click()
Me.Cls
End SubPrivate Sub Timer1_Timer()
Dim a As POINTAPI
GetCursorPos a
Print a.x, a.y
End Sub