Skip to main content

GameWindowInfo

Electron APIs / overlay / GameWindowInfo

Information about a running game's window.

Used to determine:

  • Window size.
  • Window focus.
  • Graphics API used by the game.
  • Screen display information.
  • Bounding rectangle of the game window.

Example

overlay.on("game-window-changed", (windowInfo, gameInfo, reason) => {
if (windowInfo.focused) {
console.log(
`Game window is focused. Size: ${windowInfo.size.width}x${windowInfo.size.height}`,
);
}
});

Properties

PropertyModifierTypeDescription
bounds?readonlyanyThe bounding rectangle of the game window in the screen's coordinates. For example: bounds: { x: 100, y: 100, width: 800, height: 600 } Means the game window is positioned at (100, 100) on the screen and has a size of 800x600 pixels. Since 1.5.11.
focusedreadonlybooleanIndicates if the game window is currently in focus.
graphicsreadonlyundefined | stringThe graphics API used by the game (e.g., Direct3D 9, 11, 12, Vulkan).
nativeHandlereadonlynumberThe native window handle (HWND) of the game window.
screen?readonlyanyDisplay information for the screen on which the game window resides. Since 1.5.11.
sizereadonlySizeThe dimensions of the game window.