public static IEnumerable <string> EnumerateAll() { foreach (var winSta in WindowStation.Enumerate()) { foreach (var desktop in Desktop.Enumerate(winSta)) { foreach (var window in Window.Enumerate(desktop)) { yield return($"{winSta}, {desktop}, {window}"); } } } }
public static new IEnumerable <Window> EnumerateAll() { foreach (var winSta in WindowStation.Enumerate()) { foreach (var desktop in Desktop.Enumerate(winSta)) { foreach (var window in Window.Enumerate(desktop)) { if (window.ClassName == DialogClassName) { yield return(window); } } } } }