Advertisement
slyfox1186

maximize-and-move-windows.ahk

Jun 3rd, 2021 (edited)
4,446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     Maximize and Move Windows
  3.  
  4.     Created by: SlyFox1186
  5.     Pastebin: https://pastebin.com/u/slyfox1186
  6.     Requires AutoHotkey.exe
  7.  
  8.     Reworked (v2.0) uses a different (easier) method of
  9.     adding/organizing window names: https://pastebin.com/t4BeVkzM
  10.     Either version works.
  11.    
  12.     This script will move all windows that match the process
  13.     names defined inside the brackets:  ["cmd" , "notepad"]
  14.     Modify '0, 0, 1920, 1080' to match your monitor's dimensions
  15.  
  16. */
  17.  
  18. #Persistent
  19. #SingleInstance, Force
  20.  
  21. ; Press Ctrl+Alt+c to activate
  22. ^!c::
  23.  
  24. For k, v in ["cmd" , "notepad"]
  25.  
  26. {
  27.     WinGet, win, List, ahk_exe %v%.exe
  28.     Loop, %win%
  29.     {
  30.         WinGet, _IsMax, MinMax, % wTitle := "ahk_id " win%A_Index%
  31.         If (_IsMax = 1)
  32.             Continue
  33.             WinActivate, % wTitle
  34.             WinMove, %wTitle%,, 0, 0, 1920, 1080
  35.     }
  36. }
  37. Return
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement