用vb编写程序,键盘控制鼠标点击
利用VB6.0工具,具体要求是:按小键盘“1”鼠标自动点击坐标:736,561按“2”鼠标自动点击坐标:738,597按“3”鼠标自动点击坐标:737,633按“4”鼠标...
利用VB 6.0工具,具体要求是:按小键盘“1”鼠标自动点击坐标:736,561 按“2”鼠标自动点击坐标:738,597 按“3”鼠标自动点击坐标:737,633 按“4”鼠标自动点击坐标:737,670 希望帮忙解决下,谢谢!!
能够后台执行这些操作要怎么做?? 展开
能够后台执行这些操作要怎么做?? 展开
1个回答
展开全部
用键盘事件接收键盘输入,然后用API SetCursorPos 来移动鼠标到指定坐标 mouse_event 来模拟鼠标单击 声明部分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, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
核心代码SetCursorPos j, i(j和i 自己写你想要的坐标)
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 '鼠标单击一次
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)
核心代码SetCursorPos j, i(j和i 自己写你想要的坐标)
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 '鼠标单击一次
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询