关于wh_journalrecord的疑问

xiao2004 2005-04-21 05:56:21
function hookproc(icode:integer;wparam:WPARAM;lparam:LPARAM):LRESULT;stdcall;
begin
{ result:=0;
if icode<0 then
result:=callnexthookex(hhook,icode,wparam,lparam)
else if icode=hc_sysmodalon then
else if icode=hc_sysmodaloff then
else }if icode=hc_action then
begin
eventarr[eventlog]:=peventmsg(lparam)^;
inc(eventlog);
if eventlog>=1000 then
begin
unhookwindowshookex(hhook);
end;
end;
end;

就说这段回调函数吧,重点在被注释那一段,那一段可有可无都无所谓,郁闷的是,这个钩子只是保存信息吗?根本不需要传递到下一个消息链,还是本身就没有插入到消息链,而仅仅是纪录而已,我也是猜测想,去CSDN问问去....

...全文
89 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiao2004 2005-04-21
  • 打赏
  • 举报
回复
result:=callnexthookex(hhook,icode,wparam,lparam);
主要问题在这一句,连钩子链都没往后传,系统不会出错?????
用wm_mouse钩子时,不可能不处理这个的。
纯冰糖 2005-04-21
  • 打赏
  • 举报
回复
Study,我写写看
g961681 2005-04-21
  • 打赏
  • 举报
回复
result:=0;
if icode<0 then
beign
result:=callnexthookex(hhook,icode,wparam,lparam);
Exit;
end;
if icode=hc_sysmodalon then Exit;
if icode=hc_sysmodaloff then Exit;
if icode=hc_action then
begin
这里是做你想做的事;
end;
就是一些不太可能发生的判断而已!

1,184

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧