</head> <body> <h1>WinClose</h1> <p>지정된 창을 닫습니다.</p> <pre class="Syntax"><span class="func">WinClose</span> <span class="optional">, WinTitle, WinText, SecondsToWait, ExcludeTitle, ExcludeText</span></pre> <h2 id="Parameters">매개변수</h2> <dl> <dt>WinTitle</dt> <dd><p>목표 창을 식별하는 창 제목 또는 다른 기준. <a href="../misc/WinTitle.htm">WinTitle</a> 참조.</p></dd> <dt>WinText</dt> <dd><p>존재하면, 이 매개변수는 목표 창 텍스트의 부문자열입니다 (동봉된 Window Spy 유틸리티에 노출됨). 숨은 텍스트는 <a href="DetectHiddenText.htm">DetectHiddenText</a>가 켜져 있어야 탐지됩니다.</p></dd> <dt>SecondsToWait</dt> <dd><p>생략되거나 비어 있으면, 전혀 기다리지 않습니다. 0이면 500ms 동안 기다립니다. 그렇지 않으면, 지정 개수의 초 동안 창이 닫히기를 기다립니다 (소수점을 허용하고 <a href="../Variables.htm#Expressions">표현식</a>도 가능합니다). 창이 그 동안 닫히지 않더라도, 스크립트는 실행을 계속합니다. ErrorLevel is <strong>not</strong> set by this command, so use <a href="WinExist.htm">WinExist()</a>, <a href="IfWinExist.htm">IfWinExist</a> or <a href="WinWaitClose.htm">WinWaitClose</a> if you need to determine for certain that a window is closed. 이 명령어가 대기 상태에 있는 동안에, <a href="../Hotkeys.htm">핫키</a>, <a href="Menu.htm">맞춤 메뉴 항목</a>, 또는 <a href="SetTimer.htm">타이머</a>를 통하여 새 <a href="../misc/Threads.htm">쓰레드</a>가 기동할 수 있습니다.</p></dd> <dt>ExcludeTitle</dt> <dd><p>제목에 이 값이 있는 창은 무시합니다.</p></dd> <dt>ExcludeText</dt> <dd><p>텍스트에 이 값이 있는 창은 무시합니다.</p></dd> </dl> <h2 id="Remarks">논평</h2> <p>이 명령어는 창에 닫기 메시지를 전송합니다. 그 결과는 창에 따라 다릅니다 (데이터를 저장하도록 요구할 수 있습니다. 등등.)</p> <p>If a matching window is active, that window will be closed in preference to any other matching window. 일반적으로, 여러 창이 부합하면, 최상위 (가장 최근에 사용된) 창이 닫힙니다.</p> <p>This command operates only upon a single window except when <em>WinTitle</em> is <a href="GroupAdd.htm">ahk_group GroupName</a> (with no other criteria specified), in which case all windows in the group are affected.</p> <p>WinClose는 WM_CLOSE 메시지를 목표 창에 보냅니다. 약간 강제적인 방법으로 닫습니다. 다른 방법으로 닫으려면 다음 메시지를 보냅니다. 행위가 다를 수 있습니다. 왜냐하면. <kbd>Alt</kbd>+<kbd>F4</kbd>를 누르거나 제목 바에서 창의 닫기 버튼을 클릭한 것과 효과가 비슷하기 때문입니다:</p> <pre>PostMessage, 0x0112, 0xF060,,, WinTitle, WinText <em>; 0x0112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE</em></pre> <p>WinClose를 통하여 창이 닫히지 않으면, <a href="WinKill.htm">WinKill</a>를 사용하여 강제로 닫을 수 있습니다.</p> <p>창 제목과 텍스트는 대소문자를 구분합니다. 숨은 창은 <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a>가 켜져 있어야 탐지됩니다.</p> <h2 id="Related">관련 항목</h2> <p><a href="WinKill.htm">WinKill</a>, <a href="WinWaitClose.htm">WinWaitClose</a>, <a href="Process.htm">Process</a>, <a href="WinActivate.htm">WinActivate</a>, <a href="SetTitleMatchMode.htm">SetTitleMatchMode</a>, <a href="DetectHiddenWindows.htm">DetectHiddenWindows</a>, <a href="../misc/WinTitle.htm#LastFoundWindow">마지막 발견 창</a>, <a href="WinExist.htm">WinExist()</a>, <a href="WinActive.htm">WinActive()</a>, <a href="WinWaitActive.htm">WinWaitActive</a>, <a href="WinWait.htm">WinWait</a>, <a href="GroupActivate.htm">GroupActivate</a></p> <h2 id="Examples">예제</h2> <div class="ex" id="ExBasic"> <p><a class="ex_number" href="#ExBasic"></a> If Notepad does exist, close it, otherwise close the calculator.</p> <pre>if WinExist("Untitled - Notepad") WinClose <em>; Use the window found by WinExist.</em> else WinClose, Calculator</pre> </div> </body> </html>