IfWinExist / IfWinNotExist
지정된 창이 존재하는지 점검합니다.
비추천: 이러한 제어 흐름 서술문는 새 스크립트에 사용을 추천하지 않습니다. 대신 WinExist 기능을 사용하십시오.
IfWinExist , WinTitle, WinText, ExcludeTitle, ExcludeText
IfWinNotExist , WinTitle, WinText, ExcludeTitle, ExcludeText
매개변수
- WinTitle
- 목표 창을 식별하는 창 제목 또는 다른 기준. WinTitle 참조.
- WinText
- 존재하면, 이 매개변수는 목표 창 텍스트의 부문자열입니다 (동봉된 Window Spy 유틸리티에 노출됨). 숨은 텍스트는 DetectHiddenText가 켜져 있어야 탐지됩니다.
- ExcludeTitle
- 제목에 이 값이 있는 창은 무시합니다. 주의: Due to backward compatibility, this parameter will be interpreted as a command if it exactly matches the name of a command. 이를 우회하려면, 대신에 WinExist 함수를 사용하십시오.
- ExcludeText
- 텍스트에 이 값이 있는 창은 무시합니다.
모든 매개변수가 생략되면, 마지막 발견 창을 점검하여 여전히 존재하는지 (IfWinNotExist이라면 존재하지 않는지) 알아 봅니다.
If either of these control flow statements determines that a qualified window exists, the Last Found Window will be updated to be that window. 즉, IfWinExist가 참으로 평가되거나 IfWinNotExist가 거짓으로 평가되면, 마지막 발견 창이 갱신됩니다.
콘트롤의 HWND를 발견하려면 (Post/SendMessage 또는 DllCall에 사용하기 위해), ControlGet Hwnd 또는 MouseGetPos를 사용하십시오.
SetWinDelay does not apply to these control flow statements.
창 제목과 텍스트는 대소문자를 구분합니다. 숨은 창은 DetectHiddenWindows가 켜져 있어야 탐지됩니다.
WinExist(), WinActive(), SetTitleMatchMode, DetectHiddenWindows, 마지막 발견 창, Process, WinActivate, WinWaitActive, WinWait, WinWaitClose, #IfWinActive/Exist
예제
Activates and maximizes the Notepad window found by the IfWinExist statement above.
IfWinExist, Untitled - Notepad
{
WinActivate ; Use the window found by IfWinExist.
WinMaximize ; 위와 동일.
Send, Some text.{Enter}
return
}
Returns if the calculator does not exist, otherwise it will be activated and moved to a new position.
IfWinNotExist, Calculator
return
else
{
WinActivate ; Use the window found by IfWinNotExist.
WinMove, 40, 40 ; 위와 동일.
return
}