SHCreateItemWithParent function

Create a Shell item, given a parent folder and a child item ID.

Syntax


HRESULT SHCreateItemWithParent(
  _In_  PCIDLIST_ABSOLUTE pidlParent,
  _In_  IShellFolder      *psfParent,
  _In_  PCUITEMID_CHILD   pidl,
  _In_  REFIID            riid,
  _Out_ void              **ppvItem
);

Parameters

pidlParent [in]

Type: PCIDLIST_ABSOLUTE

The IDList of the parent folder of the item being created; the IDList of psfParent. This parameter can be NULL, if psfParent is specified.

psfParent [in]

Type: IShellFolder*

A pointer to IShellFolder interface that specifies the shell data source of the child item specified by the pidl.This parameter can be NULL, if pidlParent is specified.

pidl [in]

Type: PCUITEMID_CHILD

A child item ID relative to its parent folder specified by psfParent or pidlParent.

riid [in]

Type: REFIID

A reference to an interface ID.

ppvItem [out]

Type: void**

When this function returns, contains the interface pointer requested in riid. This will typically be IShellItem or IShellItem2.

Return value

Type: HRESULT

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

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

DLL

Shell32.dll

 

 

Show: