public ApplicationWindows(FrigoForm owner, WindowFinder finder) { Selected.Changed += (oldWindow, newWindow) => { if (oldWindow != null) { oldWindow.Selected.Value = false; } if (newWindow != null) { newWindow.Selected.Value = true; } }; Visible.Changed += (oldValue, value) => { foreach (ApplicationWindow window in windows) { window.Visible = value; } }; Layout layout = new Layout(finder.Windows); foreach (WindowHandle handle in finder.Windows) { windows.Add(new ApplicationWindow(owner, handle, windows.Count, layout.Bounds[handle])); } }
private void BeginSession() { if (active) { return; } WindowFinder finder = new WindowFinder(); if (finder.Windows.Count == 0) { return; } WindowHandle.GetForegroundWindow().PostMessage(WindowMessages.ActivateApp, 0, Thread.CurrentThread.ManagedThreadId); foreach (Screen screen in Screen.AllScreens) { ChangeDisplaySettingsEx(screen.DeviceName, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero); } Bounds = Screen.AllScreens.Select(screen => screen.Bounds).Aggregate(Rectangle.Union); backgrounds = new BackgroundWindows(this, finder); applications = new ApplicationWindows(this, finder); applications.SelectByIndex(0); Visible = true; applications.Visible.Value = true; WindowHandle.SetForeground(); active = true; }
public BackgroundWindows(FrigoForm owner, WindowFinder finder) { foreach (WindowHandle window in finder.ToolWindows.Reverse()) { backgrounds.Add(new BackgroundWindow(owner, window)); } }