Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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")
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement