The handle of the window to check.
A WindowState
object containing the state of the window.
import { WinGetStateByHandleSync, WinGetHandleSync } from '@ahmic/autoit-js';
const windowHandle = WinGetHandleSync('Untitled - Notepad');
const state = WinGetStateByHandleSync(windowHandle);
console.log(state.exists); // true if the window exists
console.log(state.visible); // true if the window is visible
Returns the state of a window.
Though the original AutoIt function returns a bitmask, this function returns an object with boolean properties for each state for ease of use.