Binarysharp.MemoryManagement.Windows.WindowCore.EnumAllWindows C# (CSharp) Method

EnumAllWindows() public static method

Enumerates all the windows on the screen.
public static EnumAllWindows ( ) : IEnumerable
return IEnumerable
        public static IEnumerable<IntPtr> EnumAllWindows()
        {
            // Create the list of windows
            var list = new List<IntPtr>();

            // For each top-level windows
            foreach (var topWindow in EnumTopLevelWindows())
            {
                // Add this window to the list
                list.Add(topWindow);
                // Enumerate and add the children of this window
                list.AddRange(EnumChildWindows(topWindow));

            }

            // Return the list of windows
            return list;
        }