Hello
I've setup WH_GETMESSAGE hook to monitor WM_CHAR message, but some applications like Word 97, Visual C++ editor etc.. generates 2 or even 3 WM_CHAR messages on single key press
so my hook procedure is called 2 or 3 times instead one
how can i fix this up, so on one key press to get only one WM_CHAR??
I tryed checking if bit 30 (counting from zero) is check in lParam of WM_CHAR but this just gives what previous state of key was so has nothing to do with multiply WM_CHARs generated by some apps.. or I am wrong somewhere here?
Also spy++ shows that only one WM_CHAR message was generated which makes me more confused....

Disclaimer: all this is not intendent for malicius usage as someone may think

thanks
Posted on 2002-05-08 16:22:45 by Mikky
or I am wrong somewhere here?
I afraid you are. Its unlikely that you get more than one message for a key. Do you hand the message correctly further to the next process? Maybe you can post a code snip with the hook handler.
Posted on 2002-05-10 03:38:52 by beaster
ok here is my hook callback procedure
its writen in c (hope u can read it) but i am planing to convert it to asm later



LRESULT CALLBACK MsgProc(int code,WPARAM wParam,WPARAM lParam)
{
if (code<0)
{
return CallNextHookEx(hHook, code,wParam,lParam);
}
if (code == HC_ACTION)
{
if (((MSG*)lParam)->message == WM_CHAR)
{
MsgBox("WM_CHAR generated");
}
}

return CallNextHookEx(hHook, code, wParam, lParam);
}


anyway the problem is that just *some* (usaly MS, like vc++ or word) apps generate multiply messages, not *all* and that confuses me
Posted on 2002-05-10 16:00:51 by Mikky