How to find a child of a parent unmanaged win32 app

天大地大妈咪最大 提交于 2019-11-29 12:43:20

There is a library which supports enumerating and searching window handles, which is available at http://mwinapi.sourceforge.net/

Just so that you do not have to reinvent the wheel every time ;)

Start with

SystemWindow.AllToplevelWindows

and then just dig your way down (looking at class names, process names, titles, dialog IDs, whatever).

Use FindWindowEx to find the Handle of the Window you're looking for. Once you have that handle, use EnumChildWindows to find the correct child you need. There's too much code involved for me to quickly write up a sample, but there's enough on the web to help.

From Pinvoke.net: http://www.pinvoke.net/default.aspx/user32/EnumChildWindows.html

Have you tried to use FindWindowEx?

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