</head> <body> <h1>WinGet</h1> <p>지정된 창의 유일한 ID, 프로세스 ID, 프로세스 이름, 또는 그의 콘트롤 목록을 열람합니다. 또 지정된 기준에 부합하는 모든 창의 목록을 열람할 수도 있습니다.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar <span class="optional">, <a href="#SubCommands">SubCommand</a>, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <h2 id="Parameters">매개변수</h2> <dl> <dt>OutputVar</dt> <dd>The name of the output variable in which to store the result of <em>SubCommand</em>.</dd> <dt>SubCommand</dt> <dd>The operation to perform, which if blank defaults to the <a href="#ID">ID</a> sub-command. See <a href="#SubCommands">Sub-commands</a>.</dd> <dt>WinTitle</dt> <dd>목표 창을 식별하는 창 제목 또는 다른 기준. <a href="../misc/WinTitle.htm">WinTitle</a> 참조.</dd> <dt>WinText</dt> <dd>존재하면, 이 매개변수는 목표 창 텍스트의 부문자열입니다 (동봉된 Window Spy 유틸리티에 노출됨). 숨은 텍스트는 <a href="DetectHiddenText.htm">DetectHiddenText</a>가 켜져 있어야 탐지됩니다.</dd> <dt>ExcludeTitle</dt> <dd>제목에 이 값이 있는 창은 무시합니다.</dd> <dt>ExcludeText</dt> <dd>텍스트에 이 값이 있는 창은 무시합니다.</dd> </dl> <h2 id="SubCommands">부-명령어</h2> <p>For <em>SubCommand</em>, specify one of the following:</p> <ul> <li><a href="#ID">ID</a>: 창의 유일 ID 번호을 열람합니다.</li> <li><a href="#IDLast">IDLast</a>: Retrieves the unique ID number of the last/bottommost window if there is more than one match.</li> <li><a href="#PID">PID</a>: Retrieves the Process ID number of a window.</li> <li><a href="#ProcessName">ProcessName</a>: 창을 소유한 프로세스의 이름을 열람합니다.</li> <li><a href="#ProcessPath">ProcessPath</a> <span class="ver">[v1.1.01+]</span>: Retrieves the full path and name of the process that owns a window.</li> <li><a href="#Count">Count</a>: Retrieves the number of existing windows that match the title/text parameters.</li> <li><a href="#List">List</a>: Retrieves the unique ID numbers of all existing windows that match the title/text parameters.</li> <li><a href="#MinMax">MinMax</a>: 창에 대하여 최소/최대 상태를 열람합니다.</li> <li><a href="#ControlList">ControlList</a>: Retrieves the control name for each control in a window.</li> <li><a href="#ControlListHwnd">ControlListHwnd</a> <span class="ver">[v1.0.43.06+]</span>: Retrieves the unique ID number for each control in a window.</li> <li><a href="#Transparent">Transparent</a>: Retrieves the degree of transparency of a window.</li> <li><a href="#TransColor">TransColor</a>: 창에서 투명으로 표식이 붙은 색을 열람합니다.</li> <li><a href="#Style">Style</a>: Retrieves an 8-digit hexadecimal number representing the style of a window.</li> <li><a href="#ExStyle">ExStyle</a>: Retrieves an 8-digit hexadecimal number representing the extended style of a window.</li> </ul> <h3 id="ID">ID</h3> <p>창의 유일 ID 번호을 열람합니다.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, ID <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>Also known as the <a href="ControlGet.htm#Hwnd">window handle (HWND)</a>. 부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다. 함수 <a href="WinExist.htm">WinExist()</a>와 <a href="WinActive.htm">WinActive()</a>도 창의 ID를 열람하는 데 사용할 수 있습니다; 예를 들어, <code>WinExist("A")</code>는 활성 창의 ID를 얻는 가장 빠른 방법입니다. 콘트롤의 HWND를 발견하려면 (<a href="PostMessage.htm">Post/SendMessage</a> 또는 <a href="DllCall.htm">DllCall</a>에 사용할 목적으로), <a href="ControlGet.htm#Hwnd">ControlGet Hwnd</a> 또는 <a href="MouseGetPos.htm">MouseGetPos</a>를 사용하십시오.</p> <h3 id="IDLast">IDLast</h3> <p>Retrieves the unique ID number of the last/bottommost window if there is more than one match.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, IDLast <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>Also known as the <a href="ControlGet.htm#Hwnd">window handle (HWND)</a>. 부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다. If there is only one match, it performs identically to the <a href="#ID">ID</a> sub-command. 이 개념은 <a href="WinActivateBottom.htm">WinActivateBottom</a>이 사용하는 개념과 비슷합니다.</p> <h3 id="PID">PID</h3> <p>Retrieves the <a href="Process.htm">Process ID number</a> of a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, PID <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다.</p> <h3 id="ProcessName">ProcessName</h3> <p>창을 소유한 프로세스의 이름을 열람합니다.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, ProcessName <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>For example, this would be "notepad.exe". 부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다.</p> <h3 id="ProcessPath">ProcessPath <span class="ver">[v1.1.01+]</span></h3> <p>Retrieves the full path and name of the process that owns a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, ProcessPath <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>For example, this would be "C:\Windows\System32\notepad.exe". 부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다.</p> <h3 id="Count">Count</h3> <p>Retrieves the number of existing windows that match the title/text parameters.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, Count <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>If there are no matching windows, <em>OutputVar</em> is set to zero. 시스템의 모든 창을 열람하려면, 네 개의 매개변수를 모두 생략하십시오. 숨은 창은 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a>이 켜져 있을 때만 탐지됩니다.</p> <h3 id="List">List</h3> <p>Retrieves the unique ID numbers of all existing windows that match the title/text parameters.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, List <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>To retrieve all windows on the entire system, omit all four title/text parameters. (전체 시스템의 모든 창을 열람하려면, 네 개의 제목/텍스트 매개변수를 모두 생략하십시오). 각 ID 번호는 <em>OutputVar</em>의 이름으로 시작하는 변수에 저장됩니다 (<a href="../misc/Arrays.htm#pseudo">의사-배열</a>을 형성합니다). 반면에 <em>OutputVar</em> 자체에는 열람된 항목의 개수가 설정됩니다 (없으면 0입니다). 예를 들어, <em>OutputVar</em>가 MyArray이고 부합한 창이 두 개 발견되었다면, MyArray1은 첫 번째 창의 ID가 설정되고, MyArray2는 두 번째 창의 ID에 설정됩니다. 창은 (바탕화면에 어떻게 쌓여 있는가에 맞추어) 위에서 아래로 열람됩니다. 숨은 창은 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a>이 켜져 있을 때만 탐지됩니다. <a href="../Functions.htm">함수</a> 안에서, 지역적이 아니라 전역적 의사-배열을 생성하려면, 이 명령어를 사용하기 전에 먼저 MyArray를 전역 변수로 <a href="../Functions.htm#Global">선언</a>하십시오 (<a href="../Functions.htm#AssumeGlobal">전역-간주</a> 함수에 대하여 그 반대도 마찬가지입니다). 그렇지만, <a href="../Functions.htm#ArrayConfusion">흔한 혼란의 근원</a> 때문에 종종 집합에서 각 변수를 따로 선언할 필요가 있는 경우도 있습니다.</p> <h3 id="MinMax">MinMax</h3> <p>창에 대하여 최소/최대 상태를 열람합니다.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, MinMax <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>부합하는 창이 없으면 <em>OutputVar</em>는 비워집니다; 그렇지 않으면 다음 숫자 중 하나가 설정됩니다:</p> <ul> <li>-1: 창이 최소 상태입니다 (<a href="WinRestore.htm">WinRestore</a>로 복원할 수 있습니다).</li> <li>1: 창이 최대 상태입니다 (<a href="WinRestore.htm">WinRestore</a>로 복원할 수 있습니다).</li> <li>0: 창이 최대 상태도 아니고 최소 상태도 아닙니다.</li> </ul> <h3 id="ControlList">ControlList</h3> <p>Retrieves the control name for each control in a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, ControlList <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>부합하는 창이 존재하지 않거나 창에 콘트롤이 없으면, <em>OutputVar</em>는 비워집니다. 그렇지 않으면, Window Spy에 보여지듯이, 각 콘트롤 이름은 그의 클래스 이름과 바로 다음에 연속 번호 (ClassNN)로 구성됩니다.</p> <p>마지막 항목을 제외하고 각 항목은 라인피드로 끝납니다 (`n). To examine the individual control names one by one, use a <a href="LoopParse.htm">parsing loop</a> as shown in <a href="#ExControlList">example #3</a> below.</p> <p>Controls are sorted according to their Z-order, which is usually the same order as the navigation order via <kbd>Tab</kbd> if the window supports tabbing.</p> <h3 id="ControlListHwnd">ControlListHwnd <span class="ver">[v1.0.43.06+]</span></h3> <p>Retrieves the unique ID number for each control in a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, ControlListHwnd <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>부합하는 창이 존재하지 않거나 창에 콘트롤이 없으면, <em>OutputVar</em>는 비워집니다. Otherwise, each unique ID is the <a href="ControlGet.htm#Hwnd">window handle (HWND)</a> of the control. 마지막 항목을 제외하고 각 항목은 라인피드로 끝납니다 (`n).</p> <p>Controls are sorted according to their Z-order, which is usually the same order as the navigation order via <kbd>Tab</kbd> if the window supports tabbing.</p> <h3 id="Transparent">Transparent</h3> <p>Retrieves the degree of transparency of a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, Transparent <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>투명도를 설정하는 방법은 <a href="WinSet.htm">WinSet</a>을 참조하십시오. 다음과 같은 경우 <em>OutputVar</em>이 비워집니다: 1) OS가 Windows XP보다 구형입니다; 2) 부합하는 창이 없습니다; 3) 창에 투명도 레벨이 없습니다; 4) (OS 행위로 야기된) 기타 조건. 예를 들어 창을 투명하게 만든 이후로 최소화, 복구, 또는 크기가 바뀌었습니다. 그렇지 않으면, 0부터 255 사이의 숫자가 저장됩니다. 0은 보이지 않는 창을 나타내고 255는 완전 불투명 창을 나타냅니다. 예를 들어:</p> <pre>MouseGetPos,,, MouseWin WinGet, Transparent, Transparent, ahk_id %MouseWin% <em>; 마우스 아래의 창이 투명도.</em></pre> <h3 id="TransColor">TransColor</h3> <p>창에서 투명으로 표식이 붙은 색을 열람합니다.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, TransColor <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>See <a href="WinSet.htm#TransColor">WinSet</a> for how to set the TransColor. 다음과 같은 경우 <em>OutputVar</em>이 비워집니다: 1) OS가 Windows XP보다 오래되었습니다; 2) 부합하는 창이 없습니다; 3) 창에 투명 색이 없습니다; 4) 또는 (OS 행위로 야기된) 기타 조건. 예를 들어 창을 투명하게 만든 이후로 최소화, 복구, 또는 크기가 바뀌었습니다. 그렇지 않으면, 여섯자리 십육진 RGB 색이 저장됩니다. 예, 0x00CC99. 예를 들어:</p> <pre>MouseGetPos,,, MouseWin WinGet, TransColor, TransColor, ahk_id %MouseWin% <em>; 마우스 커서 아래에 있는 창의 TransColor.</em></pre> <h3 id="Style">Style</h3> <p>Retrieves an 8-digit hexadecimal number representing the style of a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, Style <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다. 다음 예제는 창에 WS_DISABLED 스타일이 있는지 알아봅니다:</p> <pre>WinGet, Style, Style, My Window Title if (Style &amp; 0x8000000) <em>; 0x8000000은 WS_DISABLED입니다.</em> MsgBox The window is disabled.</pre> <p>스타일 목록은 <a href="../misc/Styles.htm">스타일 테이블</a>을 참조하십시오.</p> <h3 id="ExStyle">ExStyle</h3> <p>Retrieves an 8-digit hexadecimal number representing the extended style of a window.</p> <pre class="Syntax"><span class="func">WinGet</span>, OutputVar, ExStyle <span class="optional">, WinTitle, WinText, ExcludeTitle, ExcludeText</span></pre> <p>부합하는 창이 없으면, <em>OutputVar</em>는 비워집니다. The following example determines whether a window has the WS_EX_TOPMOST style (always-on-top):</p> <pre>WinGet, ExStyle, ExStyle, My Window Title if (ExStyle &amp; 0x8) <em>; 0x8은 WS_EX_TOPMOST입니다.</em> MsgBox The window is always-on-top.</pre> <p>스타일 목록은 <a href="../misc/Styles.htm">스타일 테이블</a>을 참조하십시오.</p> <h2 id="Remarks">논평</h2> <p>창의 ID 번호는 오직 창이 살아 있을 동안에만 유효합니다. 다른 말로, 어플리케이션이 재시작하면, 그의 모든 창은 새 ID 번호를 얻습니다.</p> <p>이 명령어로 열람된 ID 번호는 숫자이고 (앞에 접두어 "ahk_id"를 포함하지 않음) 그리고 <a href="SetFormat.htm">SetFormat</a>의 설정에 상관없이 16진 형식으로 저장됩니다.</p> <p>마우스 커서 아래에 있는 창의 ID는 <a href="MouseGetPos.htm">MouseGetPos</a>로 열람할 수 있습니다.</p> <p>ID 번호는 현재 32-비트 부호없는 정수이지만, 앞으로 64-비트가 될 가능성이 있습니다. 그러므로, 이런 값들에 대해 덧셈을 하는 것과 같은 숫치 연산을 수행하는 것은 안전하지 않습니다. 왜냐하면 그런 연산은 입력 문자열을 부호없는 정수가 아니라 부호있는 정수로 해석할 필요가 있기 때문입니다.</p> <p>창 제목과 텍스트는 대소문자를 구분합니다. 숨은 창은 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a>가 켜져 있어야 탐지됩니다.</p> <h2 id="Related">관련 항목</h2> <p><a href="WinGetClass.htm">WinGetClass</a>, <a href="Process.htm">Process</a>, <a href="WinGetTitle.htm">WinGetTitle</a>, <a href="MouseGetPos.htm">MouseGetPos</a>, <a href="ControlGet.htm">ControlGet</a>, <a href="ControlFocus.htm">ControlFocus</a>, <a href="GroupAdd.htm">GroupAdd</a></p> <h2 id="Examples">예제</h2> <div class="ex" id="ExID"> <p><a class="ex_number" href="#ExID"></a> 활성 창을 최대화하고 그의 유일 ID를 보고합니다.</p> <pre>WinGet, active_id, ID, A WinMaximize, ahk_id %active_id% MsgBox, 활성 창의 ID는 "%active_id%"입니다.</pre> </div> <div class="ex" id="ExList"> <p><a class="ex_number" href="#ExList"></a> Visits all windows on the entire system and displays info about each of them.</p> <pre>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 }</pre> </div> <div class="ex" id="ExControlList"> <p><a class="ex_number" href="#ExControlList"></a> Extracts the individual control names from the active window's control list.</p> <pre>WinGet, ActiveControlList, ControlList, A Loop, Parse, ActiveControlList, `n { MsgBox, 4,, Control #%A_Index% is "%A_LoopField%". 계속할까요? IfMsgBox, No break }</pre> </div> <div class="ex" id="ExRealTime"> <p><a class="ex_number" href="#ExRealTime"></a> 실시간으로 활성 창의 콘트롤 리스트를 보여줍니다.</p> <pre>#Persistent SetTimer, WatchActiveWindow, 200 return WatchActiveWindow: WinGet, ControlList, ControlList, A ToolTip, %ControlList% return</pre> </div> </body> </html>