获取新创建的窗口,使用Win32 API钩子钩子、窗口、API

2023-09-07 09:41:07 作者:看破尘世冷暖

这可能是一个较长短,甚至不可能百利而无一害的要求。

This may be a long short or not even possible but no harm in asking.

我所试图做的是监视在其MDI控件创建任何新的窗口的应用程序。我已经实现挂接在C#中,可以捕捉MDICREATE窗口消息,但因为我需要获得有关后,一个已创建的MDICREATE消息窗口信息没有太大的帮助,因为在那个阶段的窗口还没有在其他创建应用程序呢。

What I am trying to do is monitor an application for any new windows it creates in its MDI control. I have implemented hooking in C# and can capture the MDICREATE window message but because I need to get information about the window after is has been created the MDICREATE message isn't much help because at that stage the window hasn't been created in the other application yet.

没有进入到多的细节我只需要能够看到已经创建了一个新窗口时

Without going into to much detail I just need to be able to see when a new window has been created.

这可能吗?

感谢

推荐答案

我不知道另一条消息,获取您正在寻找断手的信息的。但是,如果该消息为你工作,你可以挂钩的消息,然后做窗户的另一种扫描,找到你缺少的人。您可以枚举父窗口的子窗口。使用间谍++看到确切的窗口层次结构。

I'm not aware of another message that gets the info that you are looking for off hand. But if that message works for you, you could hook that message and then do another scan of the windows to find the one you are missing. You can enumerate the child windows of the parent window. Use Spy++ to see the exact window hierarchy.

 
精彩推荐