VB从零开始编外挂(三)
今天图老师小编要跟大家分享VB从零开始编外挂(三),精心挑选的过程简单易学,喜欢的朋友一起来学习吧!
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要VBAPI函数:
keybd_event←函数模拟了键盘行动
--------------------------------------------------------------------------------------------------------------------------------------------------------
相关API声明:
keybd_event
↓
PrivateDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要的控件:Timer(interval不为空)
--------------------------------------------------------------------------------------------------------------------------------------------------------
代码:
PrivateDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)
PrivateSubTimer1_Timer()
Callkeybd_event(82,0,0,0)'模拟按下"R"键
EndSub
--------------------------------------------------------------------------------------------------------------------------------------------------------
其它模拟:
方法一:
AppActivatesTitle
SendKeys"5"
方法二:
AppActivatesTitle
SendKeysvbKey5
方法三:
SendMessageHwnd,WM_KEYDOWN,vbKey5,0&
SendMessageHwnd,WM_KEYUP,vbKey5,0&
方法四:
AppActivatesTitle
keybd_event53,0,0,0
keybd_event53,0,KEYEVENTF_KEYUP,0
方法五:
PostMessagelHwnd,WM_KEYDOWN,vbKey5,0&
PostMessagelHwnd,WM_KEYUP,vbKey5,0&->