public SEBDesktopController.WindowCollection GetWindows() { this.CheckDisposed(); if (!this.IsOpen) { return((SEBDesktopController.WindowCollection)null); } this.m_windows.Clear(); SEBDesktopController.WindowCollection windowCollection1 = new SEBDesktopController.WindowCollection(); if (!SEBDesktopController.EnumDesktopWindows(this.m_desktop, new SEBDesktopController.EnumDesktopWindowsProc(this.DesktopWindowsProc), IntPtr.Zero)) { return((SEBDesktopController.WindowCollection)null); } SEBDesktopController.WindowCollection windowCollection2 = new SEBDesktopController.WindowCollection(); IntPtr num = Marshal.AllocHGlobal(100); foreach (IntPtr window in this.m_windows) { SEBDesktopController.GetWindowText(window, num, 100); windowCollection2.Add(new SEBDesktopController.Window(window, Marshal.PtrToStringAnsi(num))); } Marshal.FreeHGlobal(num); return(windowCollection2); }