GameWindowExtensions
Provides extension methods for GameWindow specific to Windows.
Read time 1 minuteLast updated 20 days ago
Definition
- Type: Class
- Namespace: UnityEngine.Windowing.Windows
- Assembly: UnityEngine.WindowsWindowingModule
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 |
|---|---|
| GetNativeHandle | Obtains the native Win32 window handle of the specified window. This is an extension method for GameWindow. |