Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetTitleMatchMode, 1
- ChangeDisplaySettings( cD, sW, sH, rR ) {
- VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
- DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,&dM ), NumPut(0x5c0000,dM,40)
- NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
- Return DllCall( "ChangeDisplaySettings", UInt,&dM, UInt,0 )
- }
- ; If resolution is 1920 then force a refresh rate and setup HDMI audio
- if A_ScreenWidth = 1920
- {
- ChangeDisplaySettings( (ClrDep:=32) , (Wid:=1920) , (Hei:=1080) , (Hz:=60) )
- ; Load the sound devices Control Panel
- Run, "C:\Windows\System32\mmsys.cpl"
- WinWait, Sound, , 10
- WinActivate
- Send {Down}
- Send {Down}
- Send {Down}
- Send {Tab}
- Send {Space}
- WinWait, HDMI Properties, , 0
- WinGetTitle, title, A
- ;Msgbox, %title%
- if (title == "HDMI Properties")
- {
- ;Msgbox "Here"
- Send {Esc}
- Send {Esc}
- }
- else
- {
- ;Msgbox "There"
- Send {Esc}
- }
- }
- else
- {
- ; Make sure the audio device is set back to the default
- Run, "C:\Windows\System32\mmsys.cpl"
- WinWait, Sound, , 10
- WinActivate
- Send {Down}
- Send {Down}
- Send {Tab}
- Send {Tab}
- Send {Space}
- WinWait, Notebook Audio Properties, , 0
- WinGetTitle, title, A
- ;Msgbox, %title%
- if (title == "Notebook Audio Properties")
- {
- ;Msgbox "Here"
- Send {Esc}
- Send {Esc}
- }
- else
- {
- ;Msgbox "There"
- Send {Esc}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement