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

钩子(HOOK)函数教程(十一)

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

方法6  :  DebugProc Function zdwork.cn

The DebugProc hook procedure is an application-defined or library-defined callback function used with the SetWindowsHookEx function. The system calls this function before calling the hook procedures associated with any type of hook. The system passes information about the hook to be called to the DebugProc hook procedure, which examines the information and determines whether to allow the hook to be called.

zdwork.cn

DebugProc钩子子程是和SetWindowsHookEx方法一起使用的、程序定义的或者库定义的回调函数。系统在调用和任何类型钩子相关联的钩子子程之前调用该方法。系统将即将被调用的钩子的信息传递给DebugProc钩子子程,DebugProc钩子子程检查该信息,决定是否允许该钩子被调用。 内容来自zdwork.cn

The HOOKPROC type defines a pointer to this callback function. DebugProc is a placeholder for the application-defined or library-defined function name. HOOKPROC类型定义了指向该回调函数的指针。DebugProc是程序定义的或者库定义的方法名字。

本文来自智动软件zdwork.cn

Syntax 语法

本文来自智动软件zdwork.cn

LRESULT CALLBACK DebugProc(      
    int nCode,

copyright 智动软件

    WPARAM wParam,

copyright 智动软件

    LPARAM lParam 智动软件

); www.zdwork.cn

Parameters参数

本文来自智动软件zdwork.cn

nCode [in] Specifies whether the hook procedure must process the message. If nCode is HC_ACTION, the hook procedure must process the message. If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx.

zdwork.cn

指定钩子子程是否必须处理该消息。如果nCodeHC_ACTION,钩子子程就必须处理该消息。如果nCode小于0,钩子子程就必须将该消息传递给CallNextHookEx方法,自己对消息不做进一步处理,并且应该返回由CallNextHookEx方法返回的返回值。

本文来自智动软件zdwork.cn

wParam [in] Specifies the type of hook about to be called. This parameter can be one of the following values. 指定即将被调用的钩子类型。参数可以是下列之一:

copyright 智动软件

1WH_CALLWNDPROC Installs a hook procedure that monitors messages sent to a window procedure. 安装一个钩子子程来监视发送给窗体程序的消息。 内容来自zdwork.cn

2WH_CALLWNDPROCRET Installs a hook procedure that monitors messages that have just been processed by a window procedure. 安装一个钩子子程来监视刚刚被窗体程序处理完的消息。 本文来自智动软件zdwork.cn

3WH_CBT Installs a hook procedure that receives notifications useful to a computer-based training (CBT) application. 安装一个钩子子程来接收对CBT应用程序有用的通知。 copyright 智动软件

4WH_DEBUG Installs a hook procedure useful for debugging other hook procedures. 安装一个有用的钩子子程来调试其他钩子子程。

智动软件

5WH_GETMESSAGE Installs a hook procedure that monitors messages posted to a message queue. 安装一个钩子子程来监视传递给消息队列的消息。

本文来自智动软件zdwork.cn

6WH_JOURNALPLAYBACK Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure. 安装一个钩子子程来传递先前使用WH_JOURNALRECORD钩子子程记录的消息。

www.zdwork.cn

7WH_JOURNALRECORD Installs a hook procedure that records input messages posted to the system message queue. This hook is useful for recording macros. 安装一个钩子子程来记录传递给系统消息队列的输入消息。该钩子用来记录宏很有用。 智动软件

8WH_KEYBOARD Installs a hook procedure that monitors keystroke messages. 安装一个钩子子程来监视键盘敲击消息。

本文来自智动软件zdwork.cn

9WH_MOUSE Installs a hook procedure that monitors mouse messages. 安装一个钩子子程来监视鼠标消息。

内容来自zdwork.cn

10WH_MSGFILTER Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages only for the application that installed the hook procedure. 安装一个钩子子程来监视下列输入事件的结果而产生的消息:对话框、消息框、菜单、滚动条。该钩子子程仅仅为安装该钩子子程的应用程序监视这些消息。

zdwork.cn

11WH_SHELL Installs a hook procedure that receives notifications useful to a Shell application. 安装一个钩子子程来接收对加壳类应用程序有用的通知。 本文来自智动软件zdwork.cn

12WH_SYSMSGFILTER Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages for all applications in the system. 安装一个钩子子程来监视下列输入事件的结果而产生的消息:对话框,消息框,菜单,滚动条。该钩子子程为系统中所有的应用程序监视这些消息。 www.zdwork.cn

lParam  [in] Pointer to a DEBUGHOOKINFO structure that contains the parameters to be passed to the destination hook procedure. 指向DEBUGHOOKINFO结构的指针,该结构中含有传递给目标钩子子程的参数。 内容来自zdwork.cn

Return Value返回值 本文来自智动软件zdwork.cn

To prevent the system from calling the hook, the hook procedure must return a nonzero value. Otherwise, the hook procedure must call CallNextHookEx. zdwork.cn

为了阻止系统调用该钩子,钩子子程必须返回一个非0值。否则,钩子子程必须调用CallNextHookEx方法。

智动软件

Remarks备注

www.zdwork.cn

An application installs this hook procedure by specifying the WH_DEBUG hook type and the pointer to the hook procedure in a call to the SetWindowsHookEx function. 内容来自zdwork.cn

应用程序通过下面方式安装该钩子子程:指定WH_DEBUG钩子类型;在调用SetWindowsHookEx方法的函数中指向钩子子程的指针。 内容来自zdwork.cn

Helios 2007-04-12

zdwork.cn

 

  智动软件

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

推荐内容

热门内容

相关内容


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

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