private static bool isPointWithinScreen(ComputerMonitor computerMonitor, Window application) { if (computerMonitor.screen.WorkingArea.Left <= application.Left && computerMonitor.screen.WorkingArea.Top < application.Top && computerMonitor.screen.WorkingArea.Right > application.Right && computerMonitor.screen.WorkingArea.Bottom > application.Bottom) { return(true); } return(false); }
public static ScreenManager ProcMonitors() { string msg = ""; int monId = 1; ScreenManager screenManager = new ScreenManager(); foreach (var screen in Screen.AllScreens) { var str = $"Monitor {monId}: {screen.Bounds.Width} x {screen.Bounds.Height} @ {screen.Bounds.X},{screen.Bounds.Y}\n"; msg += str; monId++; ComputerMonitor monitor = new ComputerMonitor(); monitor.screen = screen; monitor.aspectRatio = ((double)screen.Bounds.Height / screen.Bounds.Width); screenManager.ActiveMonitors.Add(monitor); } Console.WriteLine(msg); return(screenManager); }