congdantoancau

Left win Maximized/Restore windows

Jan 16th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; https://autohotkey.com/board/topic/49213-find-window-state-of-active-window-maximized-or-normal/
  2. ; https://autohotkey.com/board/topic/83948-how-to-remap-win-key-and-retain-win-key-other-key-combos/
  3. $LWin::
  4.    KeyWait, Lwin, T 0.2
  5.     If !ErrorLevel ; if you hold the LWin key for less than 200 miliseconds...
  6.     {
  7.         WinGetActiveTitle, title
  8.         WinGet, maximized, MinMax, %title%
  9.         if (maximized)
  10.             WinRestore, %title%
  11.         else
  12.             WinMaximize, %title%
  13.         return
  14.     }
  15.     Else ; but if it is held for more than that...
  16.         Send, {Lwin Down} ; ...hold LWin down
  17.     KeyWait, LWin ; and, in both cases, wait for it to be released
  18.     Send, {Lwin Up}
  19. Return
Advertisement
Add Comment
Please, Sign In to add comment