全局钩对Cwnd ::创建使用MHook [英] Global hooking to Cwnd::Create using MHook

查看:156
本文介绍了全局钩对Cwnd ::创建使用MHook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图钩到CWnd :: Create方法。我试图钩使用SetWindowsHookEx api。但这不工作一致。因此,我已遵循以下博客 http ://www.codeproject.com/Articles/49319/Easy-way-to-set-up-global-API-hooks ,并试图钩到CreateWindowEx api。

I have been trying to hook to CWnd::Create method. I tried to hook using SetWindowsHookEx api. But this is not working consistently. So, I have followed the following blog http://www.codeproject.com/Articles/49319/Easy-way-to-set-up-global-API-hooks and tried to hook to CreateWindowEx api.

这里,我不确定CreateWindowEx是否会从Cwnd :: Create API中调用。

Here, I am not sure whether CreateWindowEx will be called from Cwnd::Create API.

钩子到Cwnd ::创建过程使用MHOOK?如果这样挂钩CreatWindowEx是正确的api听Cwnd :: Create调用?

Can we hook to Cwnd::Create procedure using MHOOK? If so hooking to CreatWindowEx is the right api to listen to Cwnd::Create calls?

推荐答案

请通过此链接 http:/ /social.msdn.microsoft.com/Forums/windowsdesktop/en-US/e71f690a-00de-4032-95e2-21660e2235f6/setwindowshookex-on-windows-7

并不是所有的键盘和鼠标钩子都编组,只有全局。钩子的封送由线程消息队列执行。因此,安装hook的线程必须调用消息泵送方法。

Not all keyboard and mouse hooks are marshalled, only globals. And marshaling of hook is performed by thread message queue. So, thread that installs hook MUST call message pumping method.

这篇关于全局钩对Cwnd ::创建使用MHook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆