vb实现键盘鼠标连点
谁能帮我用vb编写一个按键盘“F10”然后每3秒钟鼠标“左键”和键盘“Enter”点一次的小程序最好能把工程发给我邮箱:baoyongge@21cn.com谢谢!!!...
谁能帮我用vb编写一个
按键盘“F10”
然后每3秒钟
鼠标“左键”
和键盘“Enter”
点一次的小程序
最好能把工程发给我
邮箱:baoyongge@21cn.com
谢谢!!! 展开
按键盘“F10”
然后每3秒钟
鼠标“左键”
和键盘“Enter”
点一次的小程序
最好能把工程发给我
邮箱:baoyongge@21cn.com
谢谢!!! 展开
展开全部
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)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Dim KB As Boolean
Private Sub Form_KeyPress(KeyAscii As Integer)
'MsgBox KeyAscii '`96
If KeyAscii = 96 Then
KB = Not KB
End If
KeyAscii = 0
Do While KB = True
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
DoEvents
Loop
End Sub
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4
Dim KB As Boolean
Private Sub Form_KeyPress(KeyAscii As Integer)
'MsgBox KeyAscii '`96
If KeyAscii = 96 Then
KB = Not KB
End If
KeyAscii = 0
Do While KB = True
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
DoEvents
Loop
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询