/// <summary> /// Create a display screen object with the current settings /// </summary> public DisplayScreen() { _devMode = new DevMode(); _devMode.dmDeviceName = new String(new char[32]); _devMode.dmFormName = new String(new char[32]); _devMode.dmSize = (short)Marshal.SizeOf(_devMode); if (0 == User32.EnumDisplaySettings(null, User32.ENUM_CURRENT_SETTINGS, ref _devMode)) throw new SystemException("Cannot load current display settings!"); }
/// <summary> /// Create a display screen object with the current settings /// </summary> public DisplayScreen() { _devMode = new DevMode(); _devMode.dmDeviceName = new String(new char[32]); _devMode.dmFormName = new String(new char[32]); _devMode.dmSize = (short)Marshal.SizeOf(_devMode); if (0 == User32.EnumDisplaySettings(null, User32.ENUM_CURRENT_SETTINGS, ref _devMode)) { throw new SystemException("Cannot load current display settings!"); } }
public static extern int EnumDisplaySettings(string deviceName, int modeNum, ref DevMode devMode);
public static extern int ChangeDisplaySettings(ref DevMode mode, int dwFlags);