Created
April 24, 2016 15:03
-
-
Save kimushu/8f675878d9b2f8dc6d704483b7751ef8 to your computer and use it in GitHub Desktop.
Shortcut for moving active window to the next monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#UseHook on | |
#NoEnv | |
#WinActivateForce | |
#SingleInstance | |
;-------------------------------------------------------------------------------- | |
; ウィンドウのモニタ間移動 | |
; | |
MoveToNextMonitor() { | |
WinGetPos,X,Y,,,A | |
SysGet,MC,MonitorCount | |
Move := 0 | |
Loop,% (MC+1) { | |
MI := Mod(A_Index - 1, MC) + 1 | |
If(Move == 1) { | |
SysGet,MA2_,Monitor,%MI% | |
WinMove,A,,(X - MA1_Left + MA2_Left),(Y - MA1_Top + MA2_Top) | |
Break | |
} | |
SysGet,MA1_,Monitor,%MI% | |
If(MA1_Left <= X && X < MA1_Right && MA1_Top <= Y && Y < MA1_Bottom) { | |
Move := 1 | |
} | |
} | |
} | |
#Esc:: | |
MoveToNextMonitor() | |
Return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment