SHGetItemFromObject function

Retrieves an IShellItem for an object.

Syntax

SHSTDAPI SHGetItemFromObject(
  IUnknown *punk,
  REFIID   riid,
  void     **ppv
);

Parameters

punk

Type: IUnknown*

A pointer to the IUnknown of the object.

riid

Type: REFIID

Reference to the desired IID.

ppv

Type: void**

When this method returns, contains the interface pointer requested in riid. This is typically IShellItem or a related interface.

Return Value

Type: HRESULT

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

Remarks

From the standpoint of performance, this method is preferred to SHGetIDListFromObject in those cases where the IDList is already bound to a folder.

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)
DLL Shell32.dll

See Also

SHCreateItemFromIDList

SHGetIDListFromObject