コード例 #1
0
 /// <summary>
 /// <para>Updates the screen's settings</para>
 /// </summary>
 /// <param name="screen"></param>
 /// <returns></returns>
 public static bool UpdateScreen(ScreenEx screen)
 {
     ScreenSettingsDevMode devMode = screen.ToDEVMODE();
     DispChange result = ChangeDisplaySettingsEx(screen.Name, ref devMode, CDS.RESET | CDS.UPDATEREGISTRY);
     if (result >= 0)
         return true;
     else
         return false;
 }
コード例 #2
0
 /// <summary>
 /// <para>Updates the screen's settings and sets it as primary screen</para>
 /// </summary>
 /// <param name="screen"></param>
 /// <returns></returns>
 public static bool UpdateScreenAndMakePrimary(ScreenEx screen)
 {
     ScreenSettingsDevMode devMode = screen.ToDEVMODE();
     return ChangeDisplaySettingsEx(screen.Name, ref devMode, CDS.RESET | CDS.UPDATEREGISTRY | CDS.SET_PRIMARY) >= 0;
 }