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

时间:2010年04月21日 点击:530

方法19 :UnhookWindowsHookEx Function

The UnhookWindowsHookEx function removes a hook procedure installed in a hook chain by the SetWindowsHookEx function.

UnhookWindowsHookEx方法移除由SetWindowsHookEx方法安装在钩子链表中的钩子子程。

Syntax语法

BOOL UnhookWindowsHookEx(HHOOK hhk);

Parameters 参数

hhk [in] Handle to the hook to be removed. This parameter is a hook handle obtained by a previous call to SetWindowsHookEx. 即将被移除的钩子的句柄。该参数是由前面调用SetWindowsHookEx方法所保留的钩子句柄。

Return Value 返回值

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

如果该方法执行成功,返回非0值。如果卸载失败,返回0。调用GetLastError可以得到更多的错误信息。

Remarks备注

The hook procedure can be in the state of being called by another thread even after UnhookWindowsHookEx returns. If the hook procedure is not being called concurrently, the hook procedure is removed immediately before UnhookWindowsHookEx returns.

UnhookWindowsHookEx方法返回后,钩子子程可能处于正在被其他线程调用的状态。如果钩子子程不是被并发调用,钩子子程会在UnhookWindowsHookEx方法返回前被迅速的移除。

Helios  2007-5-31

赞助商链接

热门内容

相关内容

联系我们

联系方式