来源:网络 | 2006-12-19 | (有3663人读过)
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,,设好时间间隔。鼠标会自动进行左键点击
|