ICustomDestinationList::SetAppID method (shobjidl_core.h)

Specifies a unique Application User Model ID (AppUserModelID) for the application whose taskbar button will hold the custom Jump List built through the methods of this interface. This method is optional.

Syntax

HRESULT SetAppID(
  [in] LPCWSTR pszAppID
);

Parameters

[in] pszAppID

Type: LPCWSTR

A pointer to the AppUserModelID of the process or application whose taskbar representation receives the Jump List.

Return value

Type: HRESULT

Returns S_OK if successful, or an error value otherwise, including the following:

Return code Description
E_UNEXPECTED
This method was called after ICustomDestinationList::BeginList. The list-building process is already running with a particular AppUserModelID, either inferred by the system or set through a call to SetAppID before the call to BeginList. After a list-building operation is in progress, the AppUserModelID cannot be changed until after CommitList or AbortList has been called.

Remarks

If an application has an explicit AppUserModelID, you must call SetAppID before you call ICustomDestinationList::BeginList or ICustomDestinationList::GetRemovedDestinations.

After an AppUserModelID is specified through an object's SetAppID method, the AppUserModelID is saved in the object for that object's lifetime, providing that it is not overwritten by another call to SetAppID.

Some applications will not declare an explicit AppUserModelID and should not call this method. In that case, the application's identity is deduced when ICustomDestinationList::BeginList or ICustomDestinationList::GetRemovedDestinations are called. However, there is a performance benefit in avoiding those calculations, so applications that provide custom Jump Lists are encouraged to use explicit AppUserModelIDs.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server 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)

ICustomDestinationList

SetCurrentProcessExplicitAppUserModelID

Taskbar Extensions