internal static Monitorinfo MonitorInfoFromWindow(IntPtr hWnd)
        {
            var hMonitor    = User32.MonitorFromWindow(hWnd, 2);
            var monitorInfo = new Monitorinfo {
                CbSize = (uint)Marshal.SizeOf(typeof(Monitorinfo))
            };

            User32.GetMonitorInfo(hMonitor, ref monitorInfo);
            return(monitorInfo);
        }
Ejemplo n.º 2
0
 internal static extern bool GetMonitorInfo(IntPtr hMonitor, ref Monitorinfo monitorInfo);