如何枚举进程中的所有窗口? [英] How to enumerate all windows within a process?
本文介绍了如何枚举进程中的所有窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要捕获第三方流程的特定窗口。我可以找到主窗口句柄作为Process.MainWindowHandle,但是可以用来列出其他窗口吗?
I need to capture particular windows of 3rd party process. I can find main window handle as Process.MainWindowHandle, but what I can use to list other windows?
我正在使用C#/ .NET
I am using C# / .NET
推荐答案
第三方应用程序启动了其他窗口,而不是其他子窗口。
3rd party aplication launched other windows not as child windows.
有可能发现
此后,我能够使用WindowClassName(取自Spy ++)使用FindWindowEx函数找到必要的窗口:
lastWindows = FindWindowEx(IntPtr.Zero,lastWindows,m.WindowClassName,null);
After this, I was able to find necessary window using FindWindowEx function using WindowClassName (taken from Spy++): lastWindows = FindWindowEx(IntPtr.Zero, lastWindows, m.WindowClassName, null);
这篇关于如何枚举进程中的所有窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文