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

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

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

方法18 :SysMsgProc Function

智动软件

The SysMsgProc hook procedure is a library-defined callback function used with the SetWindowsHookEx function. The system calls this function after an input event occurs in a dialog box, message box, menu, or scroll bar, but before the message generated by the input event is processed. The function can monitor messages for any dialog box, message box, menu, or scroll bar in the system. 本文来自智动软件zdwork.cn

 SysMsgProc钩子子程是同SetWindowsHookEx一起使用的在库中定义的回调函数。在对话框、消息框、菜单、滚动条中所属的输入事件发生后,在这些消息被系统处理之前,系统调用该方法。该方法能够为系统中任何对话框、消息框、菜单、滚动条监视消息。

copyright 智动软件

The HOOKPROC type defines a pointer to this callback function. SysMsgProc is a placeholder for the application-defined or library-defined function name. 内容来自zdwork.cn

HOOKPROC类型定义了回调函数的指针,SysMsgProc是应用程序定义的或者库定义的方法的名字。 copyright 智动软件

Syntax语法 www.zdwork.cn

LRESULT CALLBACK SysMsgProc(      

    int nCode,
copyright 智动软件
    WPARAM wParam, 

智动软件

    LPARAM lParam 

copyright 智动软件

); zdwork.cn 

Parameters参数 本文来自智动软件zdwork.cn

nCode

内容来自zdwork.cn

[in] Specifies the type of input event that generated 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. This parameter can be one of the following values. 指定生成该消息的输入事件的类型。如果nCode小于0,钩子子程必须将消息传递给CallNextHookEx方法,自己不进行进一步的处理,并且应该返回由CallNextHookEx方法返回的返回值。。该参数可以是以下值之一: zdwork.cn

1MSGF_DIALOGBOX The input event occurred in a message box or dialog box.  输入事件在消息框或者对话框中发生。

copyright 智动软件

2MSGF_MENU The input event occurred in a menu.输入事件在菜单中发生。

zdwork.cn

3MSGF_SCROLLBAR The input event occurred in a scroll bar.输入事件在滚动条中发生。 内容来自zdwork.cn

wParam This parameter is not used. 该参数未使用。

内容来自zdwork.cn

lParam [in] Pointer to an MSG message structure.指向MSG消息结构的指针。 智动软件

Return Value 返回值 智动软件

If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx. 本文来自智动软件zdwork.cn

If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_SYSMSGFILTER hooks will not receive hook notifications and may behave incorrectly as a result. If the hook procedure processed the message, it may return a nonzero value to prevent the system from passing the message to the target window procedure.

www.zdwork.cn

如果nCode小于0,钩子子程必须返回由CallNextHookEx方法返回的返回值。如果nCode大于等于0,并且钩子子程还没有处理该消息,强烈要求调用CallNextHookEx方法并返回由它返回的返回值。否则,其他已经安装了WH_SYSMSGFILTER钩子的应用程序将接收不到钩子通知,可能导致行为错误。如果钩子子程已经处理了该消息,应该返回非0 值,来阻止系统将消息传递给目标窗体程序。 www.zdwork.cn

Remarks备注 智动软件

An application installs the hook procedure by specifying the WH_SYSMSGFILTER hook type and a pointer to the hook procedure in a call to the SetWindowsHookEx function.

智动软件

应用程序安装该钩子通过:指定WH_SYSMSGFILTER钩子类型;指定在调用SetWindowsHookEx方法的指向钩子子程的指针。 本文来自智动软件zdwork.cn

Helios  2007-5-31

copyright 智动软件

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

推荐内容

热门内容

相关内容


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

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