SHCreateItemWithParent function

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

Syntax

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

Parameters

pidlParent

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

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

Type: PCUITEMID_CHILD

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

riid

Type: REFIID

A reference to an interface ID.

ppvItem

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

   
Windows version Windows Vista [desktop apps only] Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll