Skip to content

Tego Bot API Documentation v0.2.0


Tego Bot API Documentation / getActiveWindow

Function: getActiveWindow()

getActiveWindow(): WindowInfo

Defined in: botjs/src/index.ts:629

Get information about the currently active (focused) window

Returns

WindowInfo

WindowInfo object with title, process, position, and dimensions

Example

typescript
import { getActiveWindow } from "@tego/botjs";

const win = getActiveWindow();
console.log(`Active window: ${win.title}`);
console.log(`Process: ${win.processPath} (PID: ${win.processId})`);
console.log(`Position: (${win.x}, ${win.y})`);
console.log(`Size: ${win.width}x${win.height}`);

Released under the MIT License.