SHCreateItemWithParent function (shobjidl_core.h)

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

Syntax

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

Parameters

[in] 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.

[in] 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.

[in] pidl

Type: PCUITEMID_CHILD

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

[in] riid

Type: REFIID

A reference to an interface ID.

[out] 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

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll