请看下列代码?能解释一下具体意思吗?
var
MsgLen:Integer=0;
MsgCou:Integer=0;
HookHandle:HHook=0;
IsHook:Boolean=False;
procedure StopHook();
begin
unhookwindowshookex(hookhandle);
hookhandle:=0;
end;
function hook(code:integer;wparam,lparam:longint):longint;stdcall;
begin
case code of
hc_skip:
begin
inc(MsgCou);
inc(msgevent);
if msgcou>=MsgLen then stophook();
Result:=0;
end;
hc_getnext:
begin
peventmsg(lparam)^:=msgevent^;
Result:=0;
end;
else
begin
Result:=callnexthookex(hookhandle,code,wparam,lparam);
end;
end;
end;
procedure StartHook();
begin
if ((hookhandle=0) and (msglen>0)) then
begin
msgevent:=@inbuff[3];
hookhandle:=setwindowshookex(wh_journalplayback,hook,hinstance,0);
end;
end;
var
MsgLen:Integer=0;
MsgCou:Integer=0;
HookHandle:HHook=0;
IsHook:Boolean=False;
procedure StopHook();
begin
unhookwindowshookex(hookhandle);
hookhandle:=0;
end;
function hook(code:integer;wparam,lparam:longint):longint;stdcall;
begin
case code of
hc_skip:
begin
inc(MsgCou);
inc(msgevent);
if msgcou>=MsgLen then stophook();
Result:=0;
end;
hc_getnext:
begin
peventmsg(lparam)^:=msgevent^;
Result:=0;
end;
else
begin
Result:=callnexthookex(hookhandle,code,wparam,lparam);
end;
end;
end;
procedure StartHook();
begin
if ((hookhandle=0) and (msglen>0)) then
begin
msgevent:=@inbuff[3];
hookhandle:=setwindowshookex(wh_journalplayback,hook,hinstance,0);
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货