c++ - how to send typing messages via WM_KEYBOARD_LL hook procedure -
I am trying to send a duplicate message to this code in an edit box window:
External "C" hook DLL_API Lavernelt callback GetMsgHookProc (int nCode, WPARAM wParam, LPARAM lParam) {if (nCode & lt; 0) {CallNextHookEx (gMsgHook, nCode, wParam, lParam); } KBDLLHOOKSTRUCT * lpk = (KBDLLHOOKSTRUCT *) lParam; GhServerWnd; // ghServerWnd == Edit1 defines that .. if (wParam == WM_KEYDOWN) {// case1: This code is working .. But, Unicode (IME character) is not sent ;; SendMessageW (ghServerWnd, WM_CHAR, (WPARAM) lpk-> vkCode, 0); // case2: This code - is not working .. T_T SendMessageW (ghServerWnd, wParam, lParam, 0); } Return CallNextHookEx (gMsgHook, ncode, wParam, lParam); }
I need help with the code marked "case2".
Thanks for reading.
Good, I'm not surprised that case 2 does not work, you send KBDLLHOOKSTRUCT to wParam Are there.
I would have thought.
SendMessage (ghServerWnd, wParam, (WPARAM) lpk-> vkCode, (LPARAM) lpk- & Gt; scan code);
Will work better (though I do not believe 100% that my LPARAM is complete).
Comments
Post a Comment