躲避了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&