예제 #1
0
        public static Monitor[] GetMonitors()
        {
            List <Monitor> monitors = new List <Monitor>();

            Int32 id = 0;

            foreach (Screen screen in Screen.AllScreens)
            {
                DEVMODE dm = new DEVMODE {
                    dmSize = (Int16)Marshal.SizeOf(typeof(DEVMODE))
                };
                EnumDisplaySettings(screen.DeviceName, EnumCurrentSettings, ref dm);
                monitors.Add(new Monitor(id++, screen.DeviceName, screen.Bounds, screen.WorkingArea, screen.Bounds, dm.dmDisplayFrequency));
            }

            return(monitors.ToArray());
        }
예제 #2
0
 public static extern int ChangeDisplaySettings(
     ref DEVMODE devMode, int flags);
예제 #3
0
 public static extern int EnumDisplaySettings(
     string deviceName, int modeNum, ref DEVMODE devMode);
예제 #4
0
 public static extern int ChangeDisplaySettingsEx(string lpszDeviceName, ref DEVMODE lpDevMode, IntPtr hwnd, uint dwflags, IntPtr lParam);
예제 #5
0
 private static extern Boolean EnumDisplaySettings(String lpszDeviceName, Int32 iModeNum, ref DEVMODE lpDevMode);