Advertisement
Guest User

Hastarin

a guest
Nov 2nd, 2008
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. SetTitleMatchMode, 1
  2.  
  3. ChangeDisplaySettings( cD, sW, sH, rR ) {
  4. VarSetCapacity(dM,156,0), NumPut(156,2,&dM,36)
  5. DllCall( "EnumDisplaySettings", UInt,0, UInt,-1, UInt,&dM ), NumPut(0x5c0000,dM,40)
  6. NumPut(cD,dM,104), NumPut(sW,dM,108), NumPut(sH,dM,112), NumPut(rR,dM,120)
  7. Return DllCall( "ChangeDisplaySettings", UInt,&dM, UInt,0 )
  8. }
  9.  
  10. ; If resolution is 1920 then force a refresh rate and setup HDMI audio
  11. if A_ScreenWidth = 1920
  12. {
  13. ChangeDisplaySettings( (ClrDep:=32) , (Wid:=1920) , (Hei:=1080) , (Hz:=60) )
  14.  
  15. ; Load the sound devices Control Panel
  16. Run, "C:\Windows\System32\mmsys.cpl"
  17.  
  18. WinWait, Sound, , 10
  19. WinActivate
  20.  
  21. Send {Down}
  22. Send {Down}
  23. Send {Down}
  24. Send {Tab}
  25. Send {Space}
  26.  
  27. WinWait, HDMI Properties, , 0
  28.  
  29. WinGetTitle, title, A
  30. ;Msgbox, %title%
  31. if (title == "HDMI Properties")
  32. {
  33. ;Msgbox "Here"
  34. Send {Esc}
  35. Send {Esc}
  36. }
  37. else
  38. {
  39. ;Msgbox "There"
  40. Send {Esc}
  41. }
  42. }
  43. else
  44. {
  45. ; Make sure the audio device is set back to the default
  46. Run, "C:\Windows\System32\mmsys.cpl"
  47.  
  48. WinWait, Sound, , 10
  49. WinActivate
  50.  
  51. Send {Down}
  52. Send {Down}
  53. Send {Tab}
  54. Send {Tab}
  55. Send {Space}
  56.  
  57. WinWait, Notebook Audio Properties, , 0
  58.  
  59. WinGetTitle, title, A
  60. ;Msgbox, %title%
  61. if (title == "Notebook Audio Properties")
  62. {
  63. ;Msgbox "Here"
  64. Send {Esc}
  65. Send {Esc}
  66. }
  67. else
  68. {
  69. ;Msgbox "There"
  70. Send {Esc}
  71. }
  72. }
  73.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement