Επεξεργασία

Κοινή χρήση μέσω


IObjectWithAppUserModelID interface (shobjidl_core.h)

Exposes methods that allow implementers of a custom IAssocHandler object to provide access to its explicit Application User Model ID (AppUserModelID). This information is used to determine whether a particular file type can be added to an application's Jump List.

Inheritance

The IObjectWithAppUserModelID interface inherits from the IUnknown interface. IObjectWithAppUserModelID also has these types of members:

Methods

The IObjectWithAppUserModelID interface has these methods.

 
IObjectWithAppUserModelID::GetAppID

Retrieves a file type handler's explicit Application User Model ID (AppUserModelID), if one has been declared.
IObjectWithAppUserModelID::SetAppID

Specifies a unique application-defined Application User Model ID (AppUserModelID) that identifies the object as a handler for a specific file type. This method is used by applications that require dynamic AppUserModelIDs.

Remarks

Only file types for which an application is a registered handler appear in that application's Jump List. When an application uses an explicit AppUserModelID to identify itself and the windows and processes that belong to it, that AppUserModelID must also be set in a handler's implementation so that the handler is recognized as being associated with that application. When the application accesses a file such that SHAddToRecentDocs is called as a result, an attempt is made to add the file to the Recent or Frequent category, or possibly a custom category, in that application's Jump List. If the application is a registered handler for that file type, identified as such by the handler's AppUserModelID matching the application's AppUserModelID, that file is added to the Jump List. If not, it is filtered and does not appear.

When to Implement

An implementation of this interface is provided in Windows. Applications that create custom Shell folders that expose an association handler enumeration needed by the system to determine the files allowed in the application's Jump List should implement their own versions.

When to Use

This object is needed only if your application is using explicit AppUserModelIDs. Without an explicit AppUserModelID to expose, there is no need for this object.

IObjectWithAppUserModelID is always used as part of a larger object that uses explicit AppUserModelIDs and wants to expose that information to the system.

The system calls the IObjectWithAppUserModelID::GetAppID method implemented on a handler to determine whether the application is a registered handler for a file type.

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)

See also

Application User Model IDs (AppUserModelIDs)

Taskbar Extensions