1
我想在此代码发送重复的消息到编辑框窗口中键入消息:如何发送通过WM_KEYBOARD_LL钩子程序
extern "C" HOOK_DLL_API LRESULT CALLBACK GetMsgHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if (nCode < 0)
{
CallNextHookEx(gMsgHook, nCode, wParam, lParam);
}
KBDLLHOOKSTRUCT *lpk = (KBDLLHOOKSTRUCT*) lParam;
ghServerWnd; // ghServerWnd == Edit1. that defined..
if (wParam == WM_KEYDOWN)
{
// case1: this code working.. but, unicode(IME character) no sent;;
SendMessageW(ghServerWnd, WM_CHAR, (WPARAM)lpk->vkCode, 0);
// case2: this code - not working.. T_T
SendMessageW(ghServerWnd, wParam, lParam, 0);
}
return CallNextHookEx(gMsgHook, nCode, wParam, lParam);
}
我需要为标记代码“案例2”的帮助。
感谢您的阅读。
其中是SendMessageW(ghServerWnd,wParam,lParam,0);功能? – jjj 2010-02-02 05:18:09