AutoHotKey 소스코드 입니다.
; 활성창을 해당 모니터 영역의 좌측 1/2영역에 배치
^+1::
WinGetActiveTitle, title
WinGetPos, x, y, Width, Height, %title%
SysGet, MonitorCount, MonitorCount
Loop, %MonitorCount%
{
SysGet, Monitor, Monitor, %A_Index%
SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index%
if (MonitorWorkAreaLeft < MonitorWorkAreaRight){
half_width := (MonitorWorkAreaRight - MonitorWorkAreaLeft) / 2
}
else {
half_width := (MonitorWorkAreaLeft - MonitorWorkAreaRight) / 2
}
if ( x >= MonitorWorkAreaLeft && x < MonitorWorkAreaRight )
{
;MsgBox, 'Target Monitor NO: ' %A_Index%
WinMove, %title%, , MonitorLeft, MonitorTop, half_width, MonitorWorkAreaBottom
Break
}
}
return
; 활성창을 해당 모니터 영역의 우측 1/2영역에 배치
^+2::
WinGetActiveTitle, title
WinGetPos, x, y, Width, Height, %title%
SysGet, MonitorCount, MonitorCount
Loop, %MonitorCount%
{
SysGet, Monitor, Monitor, %A_Index%
SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index%
if (MonitorWorkAreaLeft < MonitorWorkAreaRight){
half_width := (MonitorWorkAreaRight - MonitorWorkAreaLeft) / 2
}
else {
half_width := (MonitorWorkAreaLeft - MonitorWorkAreaRight) / 2
}
if ( x >= MonitorWorkAreaLeft && x < MonitorWorkAreaRight )
{
;MsgBox, 'Target Monitor NO: ' %A_Index%
WinMove, %title%, , MonitorLeft + half_width, MonitorTop, half_width, MonitorWorkAreaBottom
Break
}
}
return