' enumwin.vb Imports System Imports System.Diagnostics Public Class EnumWin Shared Sub Main() For Each p As Process In Process.GetProcesses() If Not p.MainWindowHandle.Equals(IntPtr.Zero) Console.WriteLine(p.ProcessName _ & " : " & p.MainWindowTitle) End If Next ' 出力例: ' vim : VIM - C:\c#\tips\enumwin\enumwin.cs ' explorer : C:\bin ' NetCaptor : NetCaptor ' OUTLOOK : 予定表 - Microsoft Outlook ' cmd : コマンド プロンプト - enumwin ' iexplore : @IT:Insider.NET - Microsoft Internet Explorer End Sub End Class ' コンパイル方法:vbc /r:System.dll enumwin.vb