Advertisement
Guest User

Untitled

a guest
May 31st, 2012
798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Move window up
  2. +#Up::
  3.   WinGetPos,X,Y,W,H,A,,,
  4.   WinMaximize
  5.   WinGetPos,TX,TY,TW,TH,ahk_class Shell_TrayWnd,,,
  6.  
  7.   ; if this is greater than 1, we're on the secondary (right) monitor. This means the center of the active window is a positive X coordinate
  8.   if ( X + W/2 > 0 ) {
  9.   SysGet, MonitorWorkArea, MonitorWorkArea, 1
  10.   WinMove,A,,X,0 , , (MonitorWorkAreaBottom/2)
  11.   }
  12.   else {
  13.   SysGet, MonitorWorkArea, MonitorWorkArea, 2
  14.   WinMove,A,,X,0 , , (MonitorWorkAreaBottom/2)
  15.   }
  16. return
  17.  
  18. ; Move window down
  19. +#Down::
  20.   WinGetPos,X,Y,W,H,A,,,
  21.   WinMaximize
  22.   WinGetPos,TX,TY,TW,TH,ahk_class Shell_TrayWnd,,,
  23.  
  24.   ; if this is greater than 1, we're on the secondary (right) monitor. This means the center of the active window is a positive X coordinate
  25.   if ( X + W/2 > 0 ) {
  26.   SysGet, MonitorWorkArea, MonitorWorkArea, 1
  27.   WinMove,A,,X,MonitorWorkAreaBottom/2 , , (MonitorWorkAreaBottom/2)
  28.   }
  29.   else {
  30.   SysGet, MonitorWorkArea, MonitorWorkArea, 2
  31.   WinMove,A,,X,MonitorWorkAreaBottom/2 , , (MonitorWorkAreaBottom/2)
  32.   }
  33. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement