2012-05-24 5 views
6

특정 제목이나 클래스 ID가있는 창이 나타나면 그 안에 영역을 그려주는 AutoHotkey 스크립트를 만들고 있습니다. 문제는 때로는 같은 제목과 클래스 ID를 갖는 여러 개의 창이 나타날 수 있다는 것입니다. 이 경우 내 스크립트는 모든 것을 탐지하지 못하고 활성 창 안의 영역 만 가져옵니다.Autohotkey : 특정 제목의 창 목록 가져 오기

제목이나 클래스 ID와 일치하거나 다른 방법으로 AHK에서 모든 창을 순환하는 모든 창 핸들 목록을 가져올 수 있습니까? list 명령으로 감사

답변

5

WinGet 핸들의 배열을 생성합니다

Winget, id, list, MyTitle 다음 도움말 파일에서 그들을 통해 루프 및 프로세스 ...

:

; Example #2: This will visit all windows on the entire system and display info about each of them: 
WinGet, id, list,,, Program Manager 
Loop, %id% 
{ 
    this_id := id%A_Index% 
    WinActivate, ahk_id %this_id% 
    WinGetClass, this_class, ahk_id %this_id% 
    WinGetTitle, this_title, ahk_id %this_id% 
    MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue? 
    IfMsgBox, NO, break 
}