static extern bool GetMonitorInfo(IntPtr hmon, ref MONITORINFO mi);
static MonitorInfo GetMonitorInfo(IntPtr hMonitor) { MONITORINFO mi = new MONITORINFO(); mi.size = (uint)Marshal.SizeOf(mi); if (!Monitors.GetMonitorInfo(hMonitor, ref mi)) return null; return new MonitorInfo { Handler = hMonitor, IsPrimary = mi.flags != 0, DisplayArea = mi.monitor.ToRect(), WorkingArea = mi.work.ToRect(), }; }