📄 hookunt.pas
字号:
unit hookunt;
interface
uses
Windows,SysUtils,Classes;
type
Thook=class
public
procedure starthook;
procedure stophook;
function getstatusout:boolean;
end;
var
lastertime:Tdatetime;
Hookhwnd:Integer;
implementation
uses shareunit;
//------------------------------------------------------------------------------
// hook 处理过程
//------------------------------------------------------------------------------
function hookproc(icode:integer;wparam:wparam;lparam:lparam):lresult;stdcall;
begin
lastertime:=time;
result:=CallNextHookEx(Hookhwnd,icode,wparam,lparam);
end;
function Thook.getstatusout:boolean;
var h,m,s,ms:word;
begin
decodetime(time-lastertime,h,m,s,ms);
result:=h*3600+m*60+s>status_outtime*60;
end;
procedure Thook.starthook;
begin
Hookhwnd:=setwindowshookex(WH_JOURNALRECORD,hookproc,hinstance,0); //安装钩子
end;
procedure Thook.stophook;
begin
unhookwindowshookex(Hookhwnd);//撤销钩子
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -