mouse_event 鼠标模拟事件
声明:
Private Declare Sub mouse_event Lib "user32" ( ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long )
变量:
鼠标左键按下 &H2
鼠标松开 = &H4
鼠标右键按下 &H8
鼠标右键松开 &H10
代码:
Private Declare Sub mouse_event Lib "user32" ( ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long )
mouse_event &H4 Or &H2, 0, 0, 0, 0 '左键单击
mouse_event &H8 Or &H10, 0, 0, 0, 0 '右键单击
'左键双击[就是两次单击]--------
mouse_event &H4 Or &H2, 0, 0, 0, 0
mouse_event &H4 Or &H2, 0, 0, 0, 0