VB模拟按键
有一个游戏,我用PostMessage,keybd_event,SendInput,SendKeys发送Tab键,可都没用,在不用WinIO的情况下,怎么办啊?-_-! 进Ring0吧。。。 怎么进?关注~~~~~ 怎么做啊,顶一下 试下SendInput吧.
http://www.m5home.com/bbs/thread-3666-1-1.html
编写驱动。驱动运行在r0层上。
不要把r0看得多神秘。
估计是游戏做了反作弊限制。 试试用AutoHotKey软件 这个问题我也不会 关注此贴 学习 http://topic.csdn.net/t/20061224/14/5252514.html '==============================模块===========================
Public Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hwnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_CHAR = &H102
Public Const VK_A = &H41
Public Const VK_b = &H42
Public Const VK_c = &H43
Public Const VK_d = &H44
Public Const VK_e = &H45
Public Const VK_f = &H46
Public Const VK_g = &H47
Public Const VK_h = &H48
Public Const VK_i = &H49
Public Const VK_j = 74
Public Const VK_k = 75
Public Const VK_l = 76
Public Const VK_m = 77
Public Const VK_n = 78
Public Const VK_o = 79
Public Const VK_p = &H50
Public Const VK_q = &H51
Public Const VK_r = &H52
Public Const VK_s = &H53
Public Const VK_t = &H54
Public Const VK_u = &H55
Public Const VK_v = &H56
Public Const VK_w = &H57
Public Const VK_x = &H58
Public Const VK_y = &H59
Public Const VK_z = &H60
Public Const VK_CONTROL = &H11 'ctrl 键
Public Const VK_Return = 13 '回车
Public Const BM_CLICK = &HF5 '鼠标左键
Public Const VK_BACKSPACE = 8 '回车
Public Const VK_Tab = 9 'TAB
Public Const VK_xg = 191 '/
'====================窗体=====================
Dim hWnd As Long
hWnd = FindWindow(vbNullString, "World of Warcraft") '得到窗口句柄,后面可改成自己游戏的标题
SendMessage hWnd, WM_KEYDOWN, VK_Tab, ByVal 0&
SendMessage hWnd, WM_KEYUP, VK_Tab, ByVal 0&
太高深了,看不懂,学习中。。。。 用全局键盘钩子... mark u p 帮 顶 为什么钩子那么让人着迷 又见钩子说法。。。。
Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WshSHell.SendKeys "{F5}+{F10}e"
'模拟按下F5+F10 SendKeys 觉对可以用,估计是因为你SendKeys的函数格式没写对,好好对照下。
补充:VB , API