GetCurrentProcessExplicitAppUserModelID 函式 (shobjidl_core.h)

擷取目前進程的應用程式定義明確應用程式使用者模型標識碼 (AppUserModelID) 。

語法

SHSTDAPI GetCurrentProcessExplicitAppUserModelID(
  [out] PWSTR *AppID
);

參數

[out] AppID

類型: PWSTR*

接收指派給進程的 AppUserModelID 位址的指標。 呼叫端負責在不再需要此字串時,使用 CoTaskMemFree 釋放此字串。

傳回值

類型: HRESULT

如果此函式成功,則會傳回 S_OK。 否則,它會傳回 HRESULT 錯誤碼。

備註

此函式擷取的 AppUserModelID 先前是透過 SetCurrentProcessExplicitAppUserModelID 來設定。

應用程式只能擷取已明確設定的AppUserModelID。 無法擷取系統指派的預設AppUserModelID。 如果應用程式需要知道其 AppUserModelID,它應該明確地設定一個。

規格需求

需求
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限桌面應用程式]
目標平台 Windows
標頭 shobjidl_core.h (包含 Shobjidl.h)
程式庫 Shell32.lib
Dll Shell32.dll (6.1 版或更新版本)

另請參閱

應用程式使用者模型標識碼 (AppUserModelIDs)

IObjectWithAppUserModelID::GetAppID

任務列延伸模組