【C#】アクティブウィンドウのウィンドウ名を取得

user32.dllのGetForegroundWindow()とGetWindowText()を使います。 class Program { [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll", EntryPoint = "GetWindowText", CharSet = CharSet.Auto)] public static extern int GetWindowText(IntPtr hWnd, StringBuild…