智动软件 - 站长优化推广网站好帮手
帐号: 密码: 注册会员
模糊 标题

钩子(HOOK)函数教程(三)

时间:2010-04-21 Tag: HOOK 钩子 教程 点击:统计中..

勿在浮沙筑高台。继续学习。今天主要学习官方的资料。但是查找到的都是E文,俺只是翻译了一下。全部查找自msdn

copyright 智动软件

Hooks tend to slow down the system because they increase the amount of processing the system must perform for each message. You should install a hook only when necessary, and remove it as soon as possible. 本文来自智动软件zdwork.cn

我将其翻译过来意思就是:

zdwork.cn

系统必须要处理每个消息,而钩子的使用增加了系统对每个消息要执行的处理的数量,因此,钩子会减慢系统。应该仅仅在必须的时候才安装钩子,并且尽可能早的将其卸载掉。

zdwork.cn

Hook Chain(钩子链表) 智动软件

The system supports many different types of hooks; each type provides access to a different aspect of its message-handling mechanism. For example, an application can use the WH_MOUSE Hook to monitor the message traffic for mouse messages. 本文来自智动软件zdwork.cn

系统支持很多不同种类的钩子,每种类型提供对消息处理机制里的某一不同方面的访问。例如,应用程序可以使用WH_MOUSE Hook监视鼠标消息的传递。 本文来自智动软件zdwork.cn

The system maintains a separate hook chain for each type of hook. A hook chain is a list of pointers to special, application-defined callback functions called hook procedures. When a message occurs that is associated with a particular type of hook, the system passes the message to each hook procedure referenced in the hook chain, one after the other. The action a hook procedure can take depends on the type of hook involved. The hook procedures for some types of hooks can only monitor messages; others can modify messages or stop their progress though the chain, preventing them from reaching the next hook procedure or the destination window.

www.zdwork.cn

系统为每类钩子维护着一个独立的钩子链表。钩子链表是一个指针的列表,其中的指针指向特定的、应用程序定义的回调函数,该函数被叫做钩子子程(hook procedure。当与某种特定类型的钩子相关联(钩住)的消息发生时,系统将消息一个接一个地传递给钩子链中的每一个钩子子程(hook procedure),钩子子程能够采取的动作取决于涉及的钩子的类型。某些类型的钩子子程仅仅能监视消息;另外一些就能够修改消息或者终止消息在钩子链表中的前进,这样就阻止了消息到达下一个钩子子程或者目标窗体。 zdwork.cn

这里有几个概念上的翻译,我参考的网上大家普遍的叫法。主要有:

内容来自zdwork.cn

Hook Chain 钩子链表 内容来自zdwork.cn

hook procedures 钩子子程(即得到消息后进行处理的程序段) 智动软件

下一个话题是钩子子程,是比较重要的内容,又比较长,放在下一篇单独讲述。 本文来自智动软件zdwork.cn

Helios 2007-4-8 www.zdwork.cn

  copyright 智动软件

  本文来自智动软件zdwork.cn

(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%

推荐内容

热门内容

相关内容


关于我们 | 联系我们 | 代理合作 | 意见及建议

本站免费提供刷IP软件,另有邮件搜索软件等,需要定制软件或有建议可联系我们。联系方式:QQ:896186342 Email:zdwork@qq.com 滇ICP备08001410号.