Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Move window up
- +#Up::
- WinGetPos,X,Y,W,H,A,,,
- WinMaximize
- WinGetPos,TX,TY,TW,TH,ahk_class Shell_TrayWnd,,,
- ; 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
- if ( X + W/2 > 0 ) {
- SysGet, MonitorWorkArea, MonitorWorkArea, 1
- WinMove,A,,X,0 , , (MonitorWorkAreaBottom/2)
- }
- else {
- SysGet, MonitorWorkArea, MonitorWorkArea, 2
- WinMove,A,,X,0 , , (MonitorWorkAreaBottom/2)
- }
- return
- ; Move window down
- +#Down::
- WinGetPos,X,Y,W,H,A,,,
- WinMaximize
- WinGetPos,TX,TY,TW,TH,ahk_class Shell_TrayWnd,,,
- ; 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
- if ( X + W/2 > 0 ) {
- SysGet, MonitorWorkArea, MonitorWorkArea, 1
- WinMove,A,,X,MonitorWorkAreaBottom/2 , , (MonitorWorkAreaBottom/2)
- }
- else {
- SysGet, MonitorWorkArea, MonitorWorkArea, 2
- WinMove,A,,X,MonitorWorkAreaBottom/2 , , (MonitorWorkAreaBottom/2)
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement