<br>uses Windows, Messages;<br><br>var HookHandle: HHOOK;<br><br> // 钩子回调<br>function GetMsgProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall;<br>begin<br> if (PMsg(lParam).message = WM_TIMER) then PMsg(lParam).message := 0;<br> Result := CallNextHookEx(HookHandle, nCode, Wparam, lParam);<br>end;<br><br> // 挂钩<br>procedure HookOn;<br>begin<br> HookHandle := SetWindowsHookEx(WH_GETMESSAGE, @GetMsgProc, HInstance, 0);<br>end;<br><br> // 脱钩<br>procedure HookOff;<br>begin<br> UnHookWindowsHookEx(HookHandle);<br>end; <br><br> //导出函数<br>exports HookOn,HookOff;<br> <br>begin<br>end.<br>