六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 340|回复: 0

Delphi全局勾子和局部勾子

[复制链接]

升级  6%

15

主题

15

主题

15

主题

秀才

Rank: 2

积分
59
 楼主| 发表于 2012-12-17 21:47:42 | 显示全部楼层 |阅读模式
<div id="cnblogs_post_body">1.安装勾子用SetWindowsHookEx function来实现,对于这个函数先来看MSDN解释
Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop as the calling thread. 参考MSDN
<div class="cnblogs_code">1 HHOOK WINAPI SetWindowsHookEx(2 __in int idHook,//勾子类型3 __in HOOKPROC lpfn,//回调函数的地址4 __in HINSTANCE hMod,//一般为HInstance5 __in DWORD dwThreadId,//关联进程的句柄,如果0则关联所有正在运行的进程,全局勾子时为06 );
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表