月
月明风轻
Unregistered / Unconfirmed
GUEST, unregistred user!
写了个小程序,主要是想将键值为183的按键替换为退格键.<br>183键是调用计算器程序的.<br>用的是键盘勾子,但发现虽然能够执行退格动作,但计算器程序还是能调出来?<br>代码如下:<br><br>function KeyboardHookProc(code: Integer; wparam: WPARAM;<br> lparam: LPARAM): LRESULT; stdcall;<br>const<br> _KeyProcessMask = $80000000;<br>var<br> Msg: TMsg;<br>begin<br> Result := 0;<br> if code < 0 then<br> begin<br> Result := Windows.CallNextHookEx(hNextHookProc, code, wparam, lparam);<br> Exit;<br> end; //StrToInt(unit1.Form1.edt2.Text)<br> if ((lparam and _KeyProcessMask) = 0) and (wparam = 183) then<br> begin<br> GetMessage(Msg, 0, 0, 0);<br> PostMessage(Msg.hwnd, WM_KEYDOWN, 8, 0);<br> Result := 1;<br> end;<br>end;