public static List <IntPtr> GetDesktopWindows(IntPtr desktop) { if (desktop == IntPtr.Zero) { throw new ArgumentNullException(nameof(desktop)); } var windows = new List <IntPtr>(); EnumDesktopWindowsProc @delegate = (window, p) => { windows.Add(window); return(true); }; EnumDesktopWindows(desktop, @delegate, IntPtr.Zero); return(windows); }
private static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumDesktopWindowsProc lpfn, IntPtr lParam);
public static extern bool EnumDesktopWindows( IntPtr hDesktop, EnumDesktopWindowsProc callback, IntPtr lParam);
public static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumDesktopWindowsProc callback, IntPtr lParam);