Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IShellFolder::GetUIObjectOf method

Gets an object that can be used to carry out actions on the specified file objects or folders.


  [in]      HWND                  hwndOwner,
  [in]      UINT                  cidl,
  [in]      PCUITEMID_CHILD_ARRAY apidl,
  [in]      REFIID                riid,
  [in, out] UINT                  *rgfReserved,
  [out]     void                  **ppv


hwndOwner [in]

Type: HWND

A handle to the owner window that the client should specify if it displays a dialog box or message box.

cidl [in]

Type: UINT

The number of file objects or subfolders specified in the apidl parameter.

apidl [in]


The address of an array of pointers to ITEMIDLIST structures, each of which uniquely identifies a file object or subfolder relative to the parent folder. Each item identifier list must contain exactly one SHITEMID structure followed by a terminating zero.

riid [in]


A reference to the IID of the interface to retrieve through ppv. This can be any valid interface identifier that can be created for an item. The most common identifiers used by the Shell are listed in the comments at the end of this reference.

rgfReserved [in, out]

Type: UINT*


ppv [out]

Type: void**

When this method returns successfully, contains the interface pointer requested in riid.

Return value


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


If cidl is greater than one, the IShellFolder::GetUIObjectOf implementation should only succeed if it can create one object for all items specified in apidl. If the implementation cannot create one object for all items, this method will fail.

The following are the most common interface identifiers the Shell uses when requesting an interface from this method. The list also indicates if cidl can be greater than one for the requested interface.

Interface IdentifierAllowed cidl Value
IContextMenu The cidl parameter can be greater than or equal to one.
IContextMenu2 The cidl parameter can be greater than or equal to one.
IDataObject The cidl parameter can be greater than or equal to one.
IDropTarget The cidl parameter can only be one.
IExtractIcon The cidl parameter can only be one.
IQueryInfo The cidl parameter can only be one.


We recommend that you use the IID_PPV_ARGS macro, defined in Objbase.h, to package the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error in riid that could lead to unexpected results.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]






Shell32.dll (version 4.0 or later)

See also




Community Additions

© 2015 Microsoft