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
| Property | Modifier | Type | Description |
|---|---|---|---|
bounds? | readonly | any | The 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. |
focused | readonly | boolean | Indicates if the game window is currently in focus. |
graphics | readonly | string | undefined | The graphics API used by the game (e.g., Direct3D 9, 11, 12, Vulkan). |
isFullscreen? | readonly | boolean | Indicates if the game is currently running in fullscreen exclusive mode. Relevant only for OOPO games. Since 1.9.0 |
isOOPOFullscreenRenderingDisabled? | readonly | boolean | Indicates if fullscreen rendering is disabled. Relevant only for OOPO games. Since 1.9.0 |
isSharedTextureAvailable? | readonly | boolean | Indicates whether shared-texture (GPU) overlay rendering can actually be used with this game — gate useSharedTexture window creation on it. 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 is injected and its graphics API is detected. See Overlay examples Since 2.0.5 |
isSharedTextureSupported? | readonly | boolean | Indicates 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 is injected and its graphics API is detected. Since 2.0.0 |
nativeHandle | readonly | number | The native window handle (HWND) of the game window. |
screen? | readonly | any | Display information for the screen on which the game window resides. Since 1.5.11. |
size | readonly | Size | The dimensions of the game window. |