Z
zhengdehei
Unregistered / Unconfirmed
GUEST, unregistred user!
function StartHook(lpHwnd: Cardinal): Boolean;<br>var<br> hThread: Cardinal;<br>begin<br> Result:= false;<br> if hNextKeyHookProc <> 0 then exit;<br> hThread:= GetWindowThreadProcessId(lpHwnd);<br><br> hNextKeyHookProc:= SetWindowsHookEx(WH_KEYBOARD, @KeyHookProc, HInstance, hThread);<br> Result:= hNextKeyHookProc <> 0;<br>end;<br><br>function KeyHookProc(iCode: integer; wParam: wParam; lParam: lParam):LResult; stdcall;//HOOK过程<br>begin<br> if iCode < 0 then begin<br> Result:= CallNextHookEx(hNextKeyHookProc, iCode, wParam, lParam);<br> exit;<br> end;<br><br> Result:= 1;<br> if (iCode = HC_Action) and ((lParam and _KeyPressMask) = 0) then begin<br> case wParam of<br> 处理....<br> end;<br> end;<br>end;<br><br>这个线程键盘钩子用起一直很正常,但是重复给多个程序加载次数过多后,会出现StartHook失败,并且操作系统很多菜单点不下去,很多带密码文本框的地方,无法输入字符。<br><br>这不是什么盗号程序,只是出现了以上的现象。大概重复30次以上,就有可能出现。望高手指出错误,感谢不尽