Advertisement
djvj

restoreres

Mar 14th, 2022
1,806
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     If (restoreRes = "true") {
  2.         If FileExist(qResFullPath) {
  3.             mTable := BuildMonitorObject()  ; build a current monitor table
  4.             Loop % monitorTable.MaxIndex()  ; for each monitor
  5.             {
  6.                 If (monitorTable[A_Index].Width != mTable[A_Index].Width || monitorTable[A_Index].Height != mTable[A_Index].Height) {   ; if original width or height doesn't match current
  7.                     RLLog.Info(A_ThisFunc . " - Current resolution is " . A_ScreenWidth . "x" . A_ScreenHeight)
  8.                     supportedGraphicsMode := RLObject.checkDisplaySettings(monitorTable[A_Index].Name,monitorTable[A_Index].Width,monitorTable[A_Index].Height,monitorTable[A_Index].BitDepth,monitorTable[A_Index].Frequency)  ; check the monitor can support these settings first
  9.                     If (supportedGraphicsMode = 1) {
  10.                         RLLog.Info(A_ThisFunc . " - " . monitorTable[A_Index].Name . " supports these settings and will be restored " . monitorTable[A_Index].Width . "x" . monitorTable[A_Index].Height . " " . monitorTable[A_Index].BitDepth . "bit " . monitorTable[A_Index].Frequency . "hz")
  11.                         supportedGraphicsMode := RLObject.changeDisplaySettings(monitorTable[A_Index].Name,monitorTable[A_Index].Width,monitorTable[A_Index].Height,monitorTable[A_Index].BitDepth,monitorTable[A_Index].Frequency) ; restore monitor settings recorded at launch
  12.                     } Else
  13.                         RLLog.Error(A_ThisFunc . " - " . monitorTable[A_Index].Name . " does not support these settings and will not be restored. Please report this error. " . monitorTable[A_Index].Width . "x" . monitorTable[A_Index].Height . " " . monitorTable[A_Index].BitDepth . "bit " . monitorTable[A_Index].Frequency . "hz")
  14.                 } Else
  15.                     RLLog.Info(A_ThisFunc . " - Resolution for " . monitorTable[A_Index].Name . " (" . monitorTable[A_Index].Width . "x" . monitorTable[A_Index].Height . ") is correct and does not need to be restored")
  16.             }
  17.         }
  18.     }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement