Skip to content

Tego Bot API Documentation v0.1.1


Tego Bot API Documentation / getActiveWindow

Function: getActiveWindow()

getActiveWindow(): WindowInfo

Defined in: index.ts:651

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.