躲避了NP的扫描现在就可以模拟了!
———————————————————————————
需要VB API函数:
keybd_event ←函数模拟了键盘行动
——————————————————————————–
相关API声明:
keybd_event
↓
Private Declare Sub keybd_event Lib user32 (ByVal bVk As Byte, ByVal Scan As Byte,
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
——————————————————————————–
需要的控件:Timer(interval不为空)
——————————————————————————–
代码:
Private Declare Sub keybd_event Lib user32 (ByVal bVk As Byte, ByVal Scan As Byte,
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Timer1_Timer()
Call keybd_event(82, 0, 0, 0) '模拟按下R键
End Sub
——————————————————————————
其它模拟:
方法一:
AppActivate sTitle
SendKeys 5
方法二:
AppActivate sTitle
SendKeys vbKey5
方法三:
SendMessage Hwnd, WM_KEYDOWN, vbKey5, 0&
SendMessage Hwnd, WM_KEYUP, vbKey5, 0&
方法四:
AppActivate sTitle
keybd_event 53, 0, 0, 0
keybd_event 53, 0, KEYEVENTF_KEYUP, 0
方法五:
PostMessage lHwnd, WM_KEYDOWN, vbKey5, 0&
PostMessage lHwnd, WM_KEYUP, vbKey5, 0&
VB 从零开始编外挂(三)
未经允许不得转载:Sleep's Blog » VB 从零开始编外挂(三)