S
sy0116
Unregistered / Unconfirmed
GUEST, unregistred user!
我正在学HOOK,在网上抄了这样一段代码,但发现竟然有错误,代码如下,我发现:只要把GetKeyState(VK_CONTROL)<0<br>这一句去掉就没错误了,不知是何原因,错误信息:<br>[Error] keyhook1.dpr(25): Operator not applicable to this operand type<br>=============================================================================<br>function HookProc(ncode,wparam,lparam:Integer):Integer;stdcall;<br>var<br> winhandle:HWND;<br>begin<br> if ((wParam=VK_F12) and GetKeyState(VK_CONTROL)<0) then<br> begin<br> winhandle:=GetForegroundWindow;<br> ShowMessage('ok');<br> end;<br> Result:=CallNextHookEx(oldhook,nCode,wParam,lParam);<br>end;