Get children windows of window by handle or pid

≯℡__Kan透↙ 提交于 2019-12-04 09:27:52

Clearly you are not actually talking about child windows, EnumWindows() doesn't enumerate them. These are surely owned windows, they stay on top of their owner and get minimized when the owner is minimized. Used for tool windows and dialogs, like Paint.NET uses. There is no dedicated winapi function to enumerate owned windows.

You can make it more efficient. Enumerate the threads in the process, use Process.Threads. Then for each thread use EnumThreadWindows(). GetWindowLongPtr() with GWLP_HWNDPARENT returns the handle of the owner, non-zero if it is an owned window.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!