请问如何在钩子的回调函数中把消息截获下来,不让它传给相应的窗口? ( 积分: 100 )

  • 主题发起人 主题发起人 chengang_1981
  • 开始时间 开始时间
C

chengang_1981

Unregistered / Unconfirmed
GUEST, unregistred user!
如题所示:<br>比如下面就是回调函数,,中间应该怎么写才能实现这个目的。<br>function TestHookProc(Code:Integer;WParam:WParam;Msg:LongInt):LRESULT;stdcall;<br>begin<br>end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 谢先拉!
 
如题所示:<br>比如下面就是回调函数,,中间应该怎么写才能实现这个目的。<br>function TestHookProc(Code:Integer;WParam:WParam;Msg:LongInt):LRESULT;stdcall;<br>begin<br>end;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 谢先拉!
 
钩子挂在哪里?系统中?消息队列中?
 
钩子写在dll中,监视QQ的登陆窗口,我想把它的所有消息截获下来,,使它接受不到所有消息,请问大虾这如何实现?
 
问题已经解决:<br>如下:<br>function TestHookProc(Code:Integer;WParam:WParam;Msg:LongInt):LRESULT;stdcall;<br>begin<br>if Code=HC_ACTION then<br>begin<br>PMsg(Msg)^.message:=0;<br>end;<br>Result:=CallNextHookEx(HookHandle,Code,WParam,longint(@Msg));<br>end;<br>end;
 
直接不调用 callnexthookex 就可以了
 
同意leizengzheng
 
to leizengzheng &nbsp;<br>试过了,,你方法要不的。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部