djvj icon

restoreres

djvj | PRO | 03/15/22 03:48:18 AM UTC | 0 ⭐ | 12208 👁️ | Never ⏰ | []
Autohotkey |

1.81 KB

|

None

|

0 👍

/

0 👎

    If (restoreRes = "true") {
        If FileExist(qResFullPath) {
            mTable := BuildMonitorObject()  ; build a current monitor table
            Loop % monitorTable.MaxIndex()  ; for each monitor
            {
                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
                    RLLog.Info(A_ThisFunc . " - Current resolution is " . A_ScreenWidth . "x" . A_ScreenHeight)
                    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
                    If (supportedGraphicsMode = 1) {
                        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")
                        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
                    } Else
                        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")
                } Else
                    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")
            }
        }
    }
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎