01. SysGet, 화면, MonitorWorkArea ;SysGet 두 번째 인자를 Monitor로 하면 화면 전체 좌표를 구한다
실행할프로그램 = notepad.exe
Loop 4
{
Run, % 실행할프로그램, , , 활성창PID
WinWaitActive, ahk_pid %활성창PID%
WinGet, 활성창HWAN, ID, ahk_pid %활성창PID%
수집된창HWAN .= 활성창HWAN " "
}
Loop, Parse, 수집된창HWAN, %A_Space%
{
If A_Index = 1
활성창HWAN1 = % A_LoopField
If A_Index = 2
활성창HWAN2 = % A_LoopField
If A_Index = 3
활성창HWAN3 = % A_LoopField
If A_Index = 4
활성창HWAN4 = % A_LoopField
}
WinMove, ahk_id %활성창HWAN1%, , % 화면Left, % 화면Top, % 화면Right / 2, % 화면Bottom / 2
WinMove, ahk_id %활성창HWAN2%, , % 화면Right / 2, % 화면Top, % 화면Right / 2, % 화면Bottom / 2
WinMove, ahk_id %활성창HWAN3%, , % 화면Left, % 화면Bottom / 2, % 화면Right / 2, % 화면Bottom / 2
WinMove, ahk_id %활성창HWAN4%, , % 화면Right / 2, % 화면Bottom / 2, % 화면Right / 2, % 화면Bottom / 2
sleep 800
명령어 = taskkill /f /im %실행할프로그램% /t
Run % 명령어, , hide