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.

Not available at injection time: the injected client reports the window only once the game's graphics device initializes, a few seconds after game-injected. Until then ActiveGameInfo.gameWindowInfo is undefined. The first game-window-changed event delivers it and is the earliest point where every field below holds a real value.

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.
graphicsreadonlystring | undefinedThe graphics API used by the game (e.g., Direct3D 9, 11, 12, Vulkan).
isFullscreen?readonlybooleanIndicates if the game is currently running in fullscreen exclusive mode. Relevant only for OOPO games. Since 1.9.0
isOOPOFullscreenRenderingDisabled?readonlybooleanIndicates if fullscreen rendering is disabled. Relevant only for OOPO games. Since 1.9.0
isSharedTextureAvailable?readonlybooleanIndicates whether shared-texture (GPU) overlay rendering can actually be used with this game. Not a precondition for creating a window: a useSharedTexture window may be created before this value resolves, and the overlay corrects the rendering path on its own. Read it to observe the outcome, or to branch when the window behaves differently on each path. true when the game's graphics API supports it (GameWindowInfo.isSharedTextureSupported), no GPU adapter mismatch was detected, and the path was not abandoned after repeated in-game copy failures. When it is false, the shared-texture-unavailable event names the reason. It can therefore turn false mid-game: the copy-failure verdict is reached only after frames were sent and repeatedly failed to draw. undefined until the game's graphics device initializes, a few seconds after game-injected; the first game-window-changed event carries the resolved value. See Overlay examples Since 2.0.5
isSharedTextureSupported?readonlybooleanIndicates whether the game's graphics API supports shared-texture (GPU) overlay rendering: true for D3D11 / D3D12, false for D3D9 / OpenGL / Vulkan. This is a capability probe only — to decide whether the path can actually be used on this machine, gate on GameWindowInfo.isSharedTextureAvailable instead. undefined until the game's graphics device initializes, a few seconds after game-injected; the first game-window-changed event carries the resolved value. Since 2.0.0
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.