共用方式為


Win32Interop.GetWindowIdFromWindow(IntPtr)方法

Reference

Definition

命名空間: Microsoft.UI

若所提供的 WindowId 是有效,則得到對應於指定 HWND

public static WindowId GetWindowIdFromWindow(IntPtr hwnd);

Parameters

hwnd IntPtr

要取得 WindowId 視窗的把手

Returns

WindowId

若所提供的 hwnd 有效,則該識別碼對應於指定的 hwnd。 否則為 null

適用對象

Product 引進於
WinUI 3 Windows 應用程式 SDK 1.0

另請參閱