Function WinWaitCloseByHandle

  • Waits for a window to close.

    Parameters

    • windowHandle: bigint

      The handle of the window to wait for.

    • timeout: number = 0

      The timeout in seconds. Default is 0 (wait indefinitely).

    Returns number

    1 if the window closes, 0 if the timeout is reached.

    import { WinWaitCloseByHandle, WinGetHandle } from '@ahmic/autoit-js';

    const handle = WinGetHandle('Untitled - Notepad');
    WinWaitCloseByHandle(handle, 10);