Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi);