SHCreateFileDataObject

Go to Home Page

Creates a data object for one or more files

Syntax

HRESULT WINAPI SHCreateFileDataObject (
    LPITEMIDLIST pidlFolder,
    UINT cidl,
    LPITEMIDLIST* apidl,
    IDataObject* pDataInner,
    IDataObject** ppDataObj
)

Parameters

pidlFolder
Id list for the parent folder
cidl
Number of child id lists in the 'apidl' array
apidl
Id lists that identify objects to hold in the data object
pDataInner
Optional IDataObject interface used to provide support for non-default FORMATETC formats
ppDataObj
Pointer to the returned IDataObject interface. Cannot be NULL

Return Value

S_OK on success, E_OUTOFMEMORY otherwise

Remarks

This function is almost identical to the documented SHCreateDataObject, except it exists in platforms prior to Vista and doesn't support creating a specific interface. Also unlike its documented counterpart, this one supports the CF_HDROP format, making it ideal for use with older IDropTargets that don't understand the newer CFSTR_SHELLIDLIST formats.

This function is also known as _SHCreateFileDataObject@20.