GetCurrentProcessExplicitAppUserModelID function

Retrieves the application-defined, explicit Application User Model ID (AppUserModelID) for the current process.

Syntax

SHSTDAPI GetCurrentProcessExplicitAppUserModelID(
  PWSTR *AppID
);

Parameters

AppID

Type: PWSTR*

A pointer that receives the address of the AppUserModelID assigned to the process. The caller is responsible for freeing this string with CoTaskMemFree when it is no longer needed.

Return Value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The AppUserModelID retrieved by this function was set earlier through SetCurrentProcessExplicitAppUserModelID.

An application can only retrieve an AppUserModelID that has been explicitly set. System-assigned default AppUserModelIDs cannot be retrieved. If the application requires knowledge of its AppUserModelID it should set one explicitly.

Requirements

   
Windows version Windows 7 [desktop apps only] Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
Library Shell32.lib
DLL Shell32.dll (version 6.1 or later)

See Also

Application User Model IDs (AppUserModelIDs)

IObjectWithAppUserModelID::GetAppID

Taskbar Extensions