Advertisement
Guest User

AutoIt Script - Dolphin Resize Window

a guest
Feb 25th, 2022
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. #include <MsgBoxConstants.au3>
  2.  
  3. ; This script resizes Dolphin Emulator's window automatically by manually entering a width and height for the game being played.
  4. ; Great for native resolution screenshots. https://www.mariowiki.com/User:Wildgoosespeeder/sandbox#GCN/Wii
  5. ; This removes trial and error from the window resizing process due to a bug in the emulator's code, if the game's resolution is known.
  6. ; If running Dolphin Emulator as administrator, AutoIt needs to run in this mode too, or else the script doesn't work.
  7. ; Script designed with development builds of Dolphin Emulator after 5.0 release with emulation render in main window, not separate window. Can be adjusted.
  8.  
  9. ; 16px for QT width, 121px for QT height. 40px QT height if render is in a separate window.
  10. ; Can be adjusted if running on something other than Windows 10 Build 21H2 or end result is wrong.
  11. Local $sQTW = 16
  12. Local $sQTH = 121
  13.  
  14. ; Define variables
  15. Local $sWidth = Int(InputBox("Dolphin Emulator Question", "How wide is the game at native resolution?", "640"))
  16. Local $sHeight = Int(InputBox("Dolphin Emulator Question", "How tall is the game at native resolution?", "480"))
  17.  
  18. ; User input requested
  19. MsgBox($MB_SYSTEMMODAL, "ALERT: Change To Emulator Window", "After pressing OK, switch to the window where the emulation is displaying. You have 5 seconds or the script produces an error. Verify the resize by taking a screenshot (F9). Adjust emulator and script settings accordingly if PNG is not " & $sWidth & "x" & $sHeight & " for the game.")
  20.  
  21. ; Hook into process by allowing 5 seconds for user
  22. Local $hWnd = WinWaitActive("[CLASS:Qt5150QWindowIcon]", "", 5)
  23.  
  24. ; Apply the user input to the QT width and height.
  25. $sQTW += $sWidth
  26. $sQTH += $sHeight
  27.  
  28. ; Resize and center the window
  29. WinMove($hWnd, "", Int(@DesktopWidth / 2) - ($sQTW / 2), Int(@DesktopHeight / 2) - ($sQTH / 2), Int($sQTW), Int($sQTH), 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement