| title | Win32Interop.GetWindowFromWindowId(WindowId) method |
|---|---|
| description | Gets the window handle that corresponds to the specified *windowId*, if the provided *windowId* is valid and the system has an `HWND` that represents the window. |
| ms.topic | article |
| ms.date | 02/08/2022 |
| keywords | windows 10, windows 11, Windows App SDK, desktop development, winui, app sdk, C#, interop, Win32Interop.GetDisplayIdFromMonitor, GetDisplayIdFromMonitor |
| ms.localizationpriority | low |
Reference
Namespace: Microsoft.UI
Gets the window handle that corresponds to the specified windowId, if the provided windowId is valid and the system has an HWND that represents the window.
public static IntPtr GetWindowFromWindowId(WindowId windowId);windowId WindowId
The identifier for the window.
The window handle that corresponds to the specified windowId, if the provided windowId is valid and the system has an HWND that represents the window. Otherwise, null.
| Product | Introduced in |
|---|---|
| WinUI | Windows App SDK 1.0 |