Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function GetMessageExtraInfo Lib "user32.dll" () As Long
Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Const MOUSEEVENTF_LEFTDOWN As Long = &H2
Private Const MOUSEEVENTF_LEFTUP As Long = &H4
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Timer1_Timer()
Dim p As POINTAPI
GetCursorPos p
mouse_event MOUSEEVENTF_LEFTDOWN, p.x, p.y, 0&, GetMessageExtraInfo()
mouse_event MOUSEEVENTF_LEFTUP, p.x, p.y, 0&, GetMessageExtraInfo()
End Sub
放上Timer1,,設好時間間隔。鼠標會自動進行左鍵點擊
本站僅提供存儲服務,所有內容均由用戶發(fā)布,如發(fā)現有害或侵權內容,請
點擊舉報。