逆向大漠插件/用VB6.0实现后台鼠标移动和后台鼠标左键点击

自动化设计软件,在一款做门的设计软件CypCut6.3 上实现了自动化勾选了 复选框。一切都是基于后台的。

Private Const GW_CHILD = 5

Private Const GW_HWNDFIRST = 0

Private Const GW_HWNDNEXT = 2

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long '发送消息,用来关闭指定程bai序

Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long

Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long

Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal fEnable As Long) As Long

Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const WM_GETTEXT = &HD&

Private Const WM_GETTEXTLENGTH = &HE&

Public Const WM_SETTEXT = &HC& '设置窗体的Caption

Private Const WM_LBUTTONDOWN = &H201

Private Const WM_LBUTTONUP = &H202

Private Const VK_CONTROL = &H11

Private Const VK_SHIFT = &H10

Private Const VK_RETURN = &HD

Private Const VK_1 = &H31

Private Const WM_KEYDOWN = &H100

Private Const WM_KEYUP = &H101

Private Const WM_MOUSEMOVE = &H200

Private Const WM_ACTIVATE = 6

Private Const WM_SETFOCUS = 7

Private Const WM_KILLFOCUS = 8

Private Const WM_NCHITTEST = &H84&

Private Const MK_LBUTTON = 1 '鼠标左键KEY

Private Const MK_RBUTTON = 2 ' 鼠标右键KEY

'模拟鼠标后台点击

Private Function SendClick(hwnd As Long, mX As Long, mY As Long)

'发送点击消息

Dim I As Long

PostMessage hwnd, WM_MOUSEMOVE, 0, (mX And &HFFFF) + (mY And &HFFFF) * &H10000 '模拟鼠标消息移动

PostMessage hwnd, WM_LBUTTONDOWN, MK_LBUTTON, (mX And &HFFFF) + (mY And &HFFFF) * &H10000 '模拟鼠标左键点击

PostMessage hwnd, WM_LBUTTONUP, 0, (mX And &HFFFF) + (mY And &HFFFF) * &H10000 '模拟鼠标右键点击

End Function

VB技术研发群 214016721

相关推荐
PhoenixAI85 小时前
显示器共享多主机切换的软件解决方案
计算机外设·显示器
Z***G4791 天前
网络爬虫学习:借助DeepSeek完善爬虫软件,实现模拟鼠标右键点击,将链接另存为本地文件
爬虫·学习·计算机外设
啃火龙果的兔子2 天前
客户端频繁调用webview方法导致前端react副作用执行异常
计算机外设·交互
4***72133 天前
网络爬虫学习:借助DeepSeek完善爬虫软件,实现模拟鼠标右键点击,将链接另存为本地文件
爬虫·学习·计算机外设
S9037845974 天前
为什么取模在除数等于2^n的时候可以用按位与替代?
java·tomcat·计算机外设·hibernate
啃火龙果的兔子4 天前
webview焦点与软键盘键盘交互详解
计算机外设·交互
平凡灵感码头4 天前
经典按键扫描程序算法实现方式
单片机·矩阵·计算机外设
YUJIANYUE7 天前
Gemini一次成型龙跟随鼠标html5+canvas特效
前端·计算机外设·html5
微波炉...7 天前
Windows11,主板自带WIFI和蓝牙,蓝牙耳机、无线鼠标卡顿
计算机外设
科技每日热闻7 天前
影刃出鞘,酣战全场!EVNIA弈威双核电竞显示器27M2N6500L震撼登场!
科技·计算机外设