wmctrl-for-windows/_dev/ListWindows.cs

18 lines
490 B
C#
Raw Normal View History

2016-01-14 04:32:17 +08:00
using System.IO;
using System;
using System.Diagnostics; // Process
2016-01-14 04:32:17 +08:00
class Program
{
static void Main()
{
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);
}
}
}
}