如何获得Top Window Handle? [英] How can I get Top Window Handle?

查看:113
本文介绍了如何获得Top Window Handle?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是谢谢你。



嗯,我试图从Process名称中获取Process的Top Window Handle。

所以我提到 http://blog.daum.net/msgmap/15698241 [ ^ ]并从流程名称获取窗口句柄。



但是检索到的Window Handle不是Process Window Handle of Process,它是进程的第一个子窗口句柄。



所以我使用FindWindow()API来获得顶层窗口处理它的类名并解决了这个问题。但是,每当我不知道类名时,我都没有使用FindWindow API。



是否有任何解决方案可以在不使用FindWinow API的情况下获得Top Window Handle?



请帮助我。

Hi, I'm always thank you.

Well, I've tried to get Process's Top Window Handle from Process name.
So I referred http://blog.daum.net/msgmap/15698241[^] and get Window Handle from Process name.

But retrieved Window Handle is not Top Window Handle of Process, it's first child window handle of process.

So I use FindWindow() API to get top Window Handle with it's class name and have solved this problem. But, whenever I didn't know the class name I didn't use FindWindow API.

Is there any solution to get Top Window Handle without using FindWinow API?

Please, help me.

推荐答案

Spy ++可以做到这一切。这是Spy ++的开源版本。如果您浏览所有代码(只需几个文件),我百分百肯定您可以找到您要找的东西。



从以下链接:

Spy++ can does that all. Here is an open source version of Spy++. I am 100% sure that you can find what you're looking for if you go through all the code (just a few files).

From the link below:
引用:

WinSpy ++可以获得以下窗口属性:



窗口类和名称。

窗口程序地址。

所有窗口样式和扩展样式。

窗口属性(使用SetProp API调用)。

完整的子和兄弟窗口关系。

滚动条位置信息。

全窗口类信息。

WinSpy++ can obtain the following window properties:

Window Class and Name.
Window procedure address.
All window styles and extended styles.
Window properties (set using the SetProp API call).
Complete Child and Sibling window relationships.
Scrollbar positional information.
Full window Class information.

< br $> b $ b

http://www.catch22.net/software/winspy -17 [ ^ ]




这可能有帮助:

GetTopWindow函数 [ ^ ]



Windows-SDK-what-a-a-top-level-window [ ^ ]



希望这有帮助!

maybe this helps :
GetTopWindow function[^]
and
Windows-SDK-What-is-a-top-level-window[^]

hope this helps!


这篇关于如何获得Top Window Handle?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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