コード例 #1
0
        static bool MonitorEnumProc(IntPtr hMonitor, IntPtr hdcMonitor, ref Rect lprcMonitor, IntPtr dwData)
        {
            MONITORINFOEX mi = new MONITORINFOEX();

            mi.Size = Marshal.SizeOf(typeof(MONITORINFOEX));
            NativeMethods.GetMonitorInfo(hMonitor, ref mi);
            Screen _screen = new Screen();

            _screen.DeviceName  = mi.DeviceName;
            _screen.WorkingArea = mi.WorkArea;
            AllScreens.Add(_screen);
            return(true);
        }
コード例 #2
0
 public static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFOEX lpmi);