获取所有有任务栏图标的窗口
我正在尝试获取仅具有任务栏图标的应用程序的所有窗口句柄。
我已转换为 C# 但失败的解决方案:
还有一些我已经忘记了。 所有这些解决方案要么崩溃,要么启动无窗口进程,例如 svchost、插件进程等。
基本上,我只需要任务栏中带有图标的活动可用窗口。 我正在使用窗口句柄,
Process.MainWindowHandle
对此有什么可行的解决方案?是否有一个包含我错过的工作解决方案的线程?
I am trying to get all the window handles of applications that have a taskbar icon only.
The solutions I have converted to C# that have failed:
Enumerate windows like alt-tab does
Enumerate windows like alt-tab does
Enumerate windows like alt-tab does
And a couple that I lost track of already.
All these solutions either crash or bring up windowless processes like svchost, plugin processes, etc.
Basically I just need the windows that are actively available in the task bar with icons.
I am using the window handle of
Process.MainWindowHandle
What are some working solutions to this? Is there a thread with a working solution that I missed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试检索设置了 MainWindowTitle 属性的所有进程。
它感觉不是一个特别优雅的解决方案,但它对我有用,只带回那些正在运行且在任务栏中明显打开的应用程序。
Try retrieving all processes where the MainWindowTitle property is set.
It doesn't feel like a particularly elegant solution, but it worked for me, bringing back only those applications which were running and visibly open in the taskbar.