VB游戏外挂编程入门(二)
2.以下为模拟键盘事件.比如模拟"r"键.
----------------------------------------------------------------------------------------------------------------------------
'在模块中定义
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
在窗口中建立一timer.时间间隔随意.只要不是0就可以了哦.呵呵.
Private Sub Timer1_Timer()
Call keybd_event(82, 0, 0, 0) '模拟按下"R"键
End Sub
----------------------------------------------------------------------------------------------------------------------------
'在模块中定义
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
在窗口中建立一timer.时间间隔随意.只要不是0就可以了哦.呵呵.
Private Sub Timer1_Timer()
Call keybd_event(82, 0, 0, 0) '模拟按下"R"键
End Sub