M
maomaoel
Unregistered / Unconfirmed
GUEST, unregistred user!
我写的一个键盘钩子程序<br>问题是按a里出来两个7,按f9时出来两个对话框,百思不得其解,请指教.<br>回调函数如下:<br>procedure hookproc(msgid,wparam,lparam:integer);stdcall;<br> var<br> keystate:tkeyboardstate;<br> presskey:array[0..1] of char;<br> focushwnd:dword;<br> begin<br><br> getkeyboardstate(keystate);<br> toascii(wparam,lparam,keystate,@presskey[0],0);<br> if presskey[0]='a' then<br> begin<br> focushwnd:=getfocus();<br> sendmessage(focushwnd,wm_ime_char,55,0);<br> end;<br> if wparam=vk_f9 then<br> messagebox(0,'chenhui','chdg',0);<br> callnexthookex(hhook,msgid,wparam,lparam);<br> end;