public Rect GetWorkAreaRect() { MONITORINFO mi = new MONITORINFO(); mi.cbSize = Marshal.SizeOf(mi); if (WindowsAPI.GetMonitorInfo(handle, ref mi)) { Rect rc = new Rect( mi.rcWork.left, mi.rcWork.top, mi.rcWork.right - mi.rcWork.left, mi.rcWork.bottom - mi.rcWork.top); return rc; } return new Rect(); }
public bool IsPrimaryMonitor() { MONITORINFO mi = new MONITORINFO(); mi.cbSize = Marshal.SizeOf(mi); if (WindowsAPI.GetMonitorInfo(handle, ref mi)) { return mi.dwFlags == MONITORINFOF_PRIMARY; } return false; }
public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi);