给定 HWND,如何获取窗口的子窗口? [英] How can I get the child windows of a window given its HWND?

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

问题描述

我有给定窗口的句柄.如何枚举它的子窗口?

I have the handle for a given window. How can I enumerate its child windows?

推荐答案

我发现最好的解决方案是 Managed WindowsAPI.它有一个 CrossHair 控件,可以用来选择一个窗口(不是问题的一部分),还有一个方法 AllChildWindows 来获取可能包装 EnumChildWindows 函数的所有子窗口.最好不要重新发明轮子.

I've found the best solution to be Managed WindowsAPI. It had a CrossHair control that could be used to select a window(not part of the question), and a method AllChildWindows to get all child windows which likely wrapped the EnumChildWindows function. Better not to reinvent the wheel.

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

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