Пример #1
0
        static MonitorArea GetMonitorAreaEx(IntPtr hMonitor)
        {
            bool success = false;

            var mi = new MONITORINFOEX()
            {
                cbSize = Marshal.SizeOf(typeof(MONITORINFOEX))
            };

            if (hMonitor != IntPtr.Zero)
            {
                success = GetMonitorInfo(hMonitor, ref mi);
            }

            return(success ? new MonitorArea(mi.rcMonitor, mi.rcWork, mi.szDevice) : null);
        }
Пример #2
0
 static extern bool GetMonitorInfo([In] IntPtr hMonitor, [In, Out] ref MONITORINFOEX lpmi);