如何获取最顶层窗口的句柄 [英] how to retrieve a handle to the topmost window

查看:144
本文介绍了如何获取最顶层窗口的句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个WINAPI问题.如标题所述,是否有一个函数可以检索到最高层次结构的句柄?例如,如果我有一个孩子,其父母是一个孩子,并且其父母是主窗口,那么检索该主窗口的句柄的函数是什么.

This is a WINAPI question. as the title says, is there a function that retrieves a handle to highest up the hierarchy? like, if i have a child, who''s parent is a child, who''s parented to the main window, what is the function that retrieves the handle to that main window. GetParent just retrieves the next one up, right?

推荐答案

您可以将GetAncestor Function与GA_ROOT标志一起使用

http://msdn.microsoft.com/en-us/library/ms633502 (v = vs.85).aspx [
You can use GetAncestor Function with GA_ROOT flag

http://msdn.microsoft.com/en-us/library/ms633502(v=vs.85).aspx[^]


这篇关于如何获取最顶层窗口的句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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