Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on May 31st, 2012  |  syntax: Autohotkey  |  size: 1.04 KB  |  views: 104  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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