共用方式為


Win32Interop.GetWindowIdFromWindow(IntPtr) 方法

參考

定義

命名空間:Microsoft.UI

如果提供的 WindowId 有效,則取得與指定 hwnd 對應的 HWND

public static WindowId GetWindowIdFromWindow(IntPtr hwnd);

參數

hwnd IntPtr

要取得 WindowId 視窗的把手

退貨

WindowId

如果所提供的 hwnd 有效,則與指定的 hwnd 對應的識別碼。 否則為 null

適用於

產品 導入於
WinUI 3 Windows App SDK 1.0

另請參閱