[vb]按住SHIFT,用鼠标点击一下屏幕上的任何一个地方,鼠标就会自动连续点击10下

朋友你好
我想用VB做一个这样的程序
启动这个程序后,这个程序就有如下功能
按住SHIFT,用鼠标点击一下屏幕上的任何一个地方,鼠标就会自动连续点击10下
这个如何能够实现呢
我是初学者,也就是菜鸟
这样的问题对我来说无疑是最难的

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
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 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button upPrivate Sub Form_Click()
MsgBox ""
End SubPrivate Sub Form_Load()
Timer1.Interval = 50
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
Dim a As Long
a = 0
If GetAsyncKeyState(vbKeyShift) Then
MsgBox "请把鼠标移到你想连点10下的地方按ENTER"
Do
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0: mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
a = a + 1
If a > 10 Then Exit Do
Loop
End IfEnd Sub 一样满足你的要求
温馨提示:内容为网友见解,仅供参考
无其他回答

[vb]按住SHIFT,用鼠标点击一下屏幕上的任何一个地方,鼠标就会自动连续点 ...
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer 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_LEFTDO...

VB怎么实现鼠标移动过去执行一个命令按下去又执行另一命令?
以一个文本框控件(Text1)为例:Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Debug.Print "这是鼠标按下去执行的命令"End Sub Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Debug.Print "这...

VB鼠标按下弹起事件
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Command1.Visible = False Command2.Visible = True End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)Command1.Visible = True Command2.Visible ...

求助VB 中想实现 按住滚轮自动点击鼠标左右键,松开滚轮就停止_百度知 ...
Shift As Integer, X As Single, Y As Single)If Button = 4 Then mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 '最好加个抬起鼠标,否则

VB.鼠标点击一个按钮,使鼠标自己获得焦点,再移向别的区域,那里便被激活...
Private Sub Text1_Click()【预定指令】End Sub Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Text1.SetFocus End Sub

VB中,如何让鼠标箭头永远追不上命令按钮,就是鼠标箭头一接近命令按钮...
把这个代码输入到记事本里面,再存储成.frm格式,用vb打开,就可以了。VERSION 5.00 Begin VB.Form game1 BorderStyle = 1 'Fixed Single Caption = "game"ClientHeight = 3030 ClientLeft = 45 ClientTop = 375 ClientWidth = 4560 LinkTopic = "For...

vb模拟鼠标 左键一直按下 和鼠标右键一直按下
窗体 Private Sub Command1_Click()Script.AddItem ("坐标:" & MouseX.Text & "-" & MouseY.Text)End SubPrivate Sub Command2_Click()Script.AddItem ("鼠标:左键")End SubPrivate Sub Command3_Click()Script.AddItem ("鼠标:右键")End SubPrivate Sub Command4_Click()If KeyText.Text ...

vb关于程序运行时用鼠标拖动而改变控件大小的问题。
vbMiddleButton 4 中间按钮按下。常数(换挡) 值 描述 vbShiftMask 1 SHIFT 键按下。vbCtrlMask 2 CTRL 键按下。vbAltMask 4 ALT 键按下。然后这些常数用作位屏蔽,对于按钮的各种组合,无须计算出各个组合的唯一的位字段值即可进行检测。要测试某一条件,首先将各个结果赋给一个临时整型变量然后...

鼠标连点器怎么设置(鼠标连点器怎么设置时间)
1、设置鼠标点击类型:首先选择鼠标的点击类型即鼠标左键或是右键; 2、设置每次点击的时间间隔:根据需要设置点击的间隔时间(0.01s-10s); 3、热键设置:设置热键就是开启点击操作的键,为避免软件使用冲突可在F1-F12键中任选一个,将鼠标移动到需要点击的地方之后按一下刚才设置的热键软件便开始运行,进行连续点击操作。

VB中如何把鼠标自动移到指定位置并单击?
单击Command1时鼠标会到(500,500)这个点作鼠标左键单击动作代码如下:Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, By...

相似回答