得到所有打开的窗口标题 [英] get the titles of all open windows
本文介绍了得到所有打开的窗口标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何可以检索所有打开的窗口的标题(包括窗口,例如在Internet Explorer中的选项卡)?
How can I retrieve the titles of all open windows (including windows such as tabs in Internet Explorer)?
推荐答案
事情是这样的:
using System.Diagnostics;
Process[] processlist = Process.GetProcesses();
foreach (Process process in processlist)
{
if (!String.IsNullOrEmpty(process.MainWindowTitle))
{
Console.WriteLine("Process: {0} ID: {1} Window title: {2}", process.ProcessName, process.Id, process.MainWindowTitle);
}
}
这篇关于得到所有打开的窗口标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文