public static extern bool EnumDisplaySettings(
     string deviceName,
     DisplaySettingsMode modeNum,
     ref DevMode devMode);
 private static DisplaySetting[] GetDisplaySettings()
 {
     var settings = new List<DisplaySetting>();
     foreach (var display in GetDisplays())
     {
         var devMode = new DevMode().Initialize();
         if (Methods.EnumDisplaySettings(display.DeviceName, DisplaySettingsMode.CurrentSettings, ref devMode))
         {
             settings.Add(new DisplaySetting {DisplayName = display.DeviceName, DevMode = devMode});
         }
     }
     return settings.ToArray();
 }
 public static extern ChangeDisplaySettingsExResults ChangeDisplaySettingsEx(
     string lpszDeviceName,
     ref DevMode lpDevMode,
     IntPtr hwnd,
     ChangeDisplaySettingsFlags dwflags,
     IntPtr lParam);