interop::GetMonitorFromDisplayId 函式 (winrt-microsoft.ui.interop.h)

如果提供的 displayId 有效,而且系統具有代表顯示監視器的 HMONITOR,則取得對應至指定 displayId 的顯示監視器句柄。

注意

此 API 會在 Windows 應用程式 SDK資料夾的\include\winrt頭檔中宣告Microsoft.UI.Interop.h

C#。 對於 C# 傳統型應用程式開發人員,此標頭中的 Interop 函式會由 Microsoft.UI.Win32Interop 類別的方法包裝。

語法

HMONITOR GetMonitorFromDisplayId(
  const winrt::Microsoft::UI::DisplayId & displayId
);

參數

displayId

類型: const DisplayId &

顯示的識別碼。

傳回值

類型: HMONITOR

如果提供的 displayId 有效,且系統具有HMONITOR代表顯示監視器的 ,則對應至指定 displayId 的顯示監視器句柄。 否則為 null

規格需求

需求
最低支援的用戶端 Windows 應用程式 SDK 1.0 或更新版本的 Windows 10 版本 1809 ()
標頭 winrt-microsoft.ui.interop.h

另請參閱

管理應用程式視窗