//键盘屏蔽请用该程序,然后给我分<br>var<br>YourHook: HHOOK;<br><br>//定义用于HOOK的消息,也可以是windows的标准消息<br>const<br>WM_YourMessage = WM_USER + 2000;<br><br>//发送你需要的消息<br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>PostMessage(self.Handle,WM_YourMessage,0,0);<br>end;<br><br>//你的HOOK处理函数<br>function YourHookProc(Code: Integer; WParam: Longint; var Msg: TMsg): Longint; stdcall;<br>begin<br>// if (Code = HC_ACTION) then<br>if Msg.Message = WM_YourMessage then<br>//调用你自己的HOOK函数<br>begin<br>showMessage('截获该消息');<br>end;<br>Result := CallNextHookEx(YourHook, Code, WParam, Longint(@Msg));<br>end;<br><br>//安装HOOK<br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>YourHook := SetWindowsHookEx(WH_GETMESSAGE, @YourHookProc, 0, GetCurrentThreadID);<br>end;