Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GameWindowExtensions

Provides extension methods for GameWindow specific to Windows.
Read time 1 minuteLast updated 20 days ago

Definition

public static class GameWindowExtensions

Remarks

Use the methods in this class to access Windows-specific properties of an existing GameWindow instance, such as the underlying Win32 window handle.

Examples

using System;using UnityEngine;using UnityEngine.Windowing;using UnityEngine.Windowing.Windows;public class WindowsWindowExtensionsExample : MonoBehaviour{ void Start() { GameWindow window = GameWindow.Main; // Get the native window handle of the main game window using the extension method IntPtr hwnd = window.GetNativeHandle(); Debug.Log($"Native handle for {window.GetTitle()}: {hwnd}"); }}

Static Methods

Method

Description

GetNativeHandleObtains the native Win32 window handle of the specified window. This is an extension method for GameWindow.