本文介绍了寻找32/64位WM_MOVING全局钩子源C ++示例。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我正在寻找一个源样本来检测x86 / x64 windows系统中的任何窗口移动(因此,一个全局钩子)。 />
我搜索了一下,但我发现全局挂钩的所有内容都以键盘/鼠标样本结束。



我检查了,它带有不同类型的键盘样本,但当我试图调整它以检测任何WM_MOVING(MoveWindow)事件,



更新:我终于设法挂钩窗口移动事件(挂钩Windows'API DefWindowProcW

,事件编号WM_MOVING = 0x0216)。

问题是MinHook只能在我自己的应用程序事件本地工作,而不是我想要的全局。



我看的原因对于一个样本是因为我不是C ++专家,正在寻找某种样本来看看。



提前谢谢。

解决方案

Hello,

I'm looking for a source sample to detect any window move (thus, a global hook) in x86/x64 windows systems.
I've searched a bit but all I found about global hooks end in keyboard/mouse samples.

I've checked the MinHook project which comes with different type of keyboard samples but when I tried to adapt it to detect any WM_MOVING (MoveWindow) event,

UPDATE: I finally managed to hook the window move event (hooking the Windows'API DefWindowProcW
with event number WM_MOVING = 0x0216).
The problem is that MinHook only works locally on the own app's events and not globally as I was intending.

The reason I was looking for a sample is because I am not a C++ expert and was looking for some sort of sample to ahve a look.

Thank you in advance.

解决方案


这篇关于寻找32/64位WM_MOVING全局钩子源C ++示例。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 17:36