WinActivate

Activates the specified window.

WinActivate , WinTitle, WinText, ExcludeTitle, ExcludeText

매개변수

WinTitle

목표 창을 식별하는 창 제목 또는 다른 기준. WinTitle 참조.

WinText

존재하면, 이 매개변수는 목표 창 텍스트의 부문자열입니다 (동봉된 Window Spy 유틸리티에 노출됨). 숨은 텍스트는 DetectHiddenText가 켜져 있어야 탐지됩니다.

ExcludeTitle

제목에 이 값이 있는 창은 무시합니다.

ExcludeText

텍스트에 이 값이 있는 창은 무시합니다.

논평

When an inactive window becomes active, the operating system also makes it foremost (brings it to the top of the stack). This does not occur if the window is already active.

If the window is minimized and inactive, it is automatically restored prior to being activated. [v1.1.20+]: If WinTitle is the letter "A" and the other parameters are omitted, the active window is restored. [v1.1.28.02+]: The window is restored even if it was already active.

목표 창을 활성화하기 위해 60ms 동안 여섯 번 시도를 합니다. If all six attempts fail, WinActivate automatically sends {Alt 2} as a workaround for possible restrictions enforced by the operating system, and then makes a seventh attempt. Thus, it is usually unnecessary to follow WinActivate with WinWaitActive, WinActive() or IfWinNotActive.

In general, if more than one window matches, the topmost matching window (typically the one most recently used) will be activated. If the window is already active, it will be kept active rather than activating any other matching window beneath it. However, if the active window is moved to the bottom of the stack with WinSet Bottom, some other window may be activated even if the active window is a match.

WinActivateBottom activates the bottommost matching window (typically the one least recently used).

GroupActivate activates the next window that matches criteria specified by a window group.

[v1.1.20+]: 활성 창이 숨어 있고 DetectHiddenWindows가 꺼져 있으면, 전혀 부합 대상으로 고려되지 않습니다. 대신에, 보이는 창이 부합하면 그 창이 활성화됩니다.

다른 창을 활성화한 후 곧바로 창이 활성화될 때, 어떤 시스템에서는 태스크 바 버튼이 깜박이기 시작할 것입니다 (OS와 그의 환경 설정에 따라 다름). 이를 피하려면 #WinActivateForce를 사용하십시오.

창 제목과 텍스트는 대소문자를 구분합니다. 숨은 창은 DetectHiddenWindows가 켜져 있어야 탐지됩니다.

알려진 문제: 스크립트가 원격 데스크탑을 통하여 접근중인 컴퓨터 또는 서버 위에서 실행중이라면 , 그 원격 데스크탑 클라이언트가 최소화될 경우 WinActivate가 마비될 수 있습니다. 한 가지 우회책은 창 활성화를 요구하지 않는 명령어를 사용하는 것입니다. 예를 들어 ControlSend 그리고 ControlClick를 사용하십시오. 또다른 우회책은 다른 레지스트리 설정을 로컬/클라이언트 컴퓨터에 적용하는 것입니다:

; HKCU을 HKLM으로 바꾸어 시스템의 모든 사용자에게 영향을 줍니다.
RegWrite REG_DWORD, HKCU, Software\Microsoft\Terminal Server Client
    , RemoteDesktop_SuppressWhenMinimized, 2

WinActivateBottom, #WinActivateForce, SetTitleMatchMode, DetectHiddenWindows, 마지막 발견 창, WinExist(), WinActive(), WinWaitActive, WinWait, WinWaitClose, WinClose, GroupActivate, WinSet

예제

If Notepad does exist, activate it, otherwise activate the calculator.

if WinExist("Untitled - Notepad")
    WinActivate ; Use the window found by WinExist.
else
    WinActivate, Calculator