Expand Minimize

SHGetDataFromIDList function

Retrieves extended property data from a relative identifier list.

Syntax


HRESULT SHGetDataFromIDList(
  _In_   IShellFolder *psf,
  _In_   PCUITEMID_CHILD pidl,
  int nFormat,
  _Out_  void *pv,
  int cb
);

Parameters

psf [in]

Type: IShellFolder*

The address of the parent IShellFolder interface. This must be the immediate parent of the ITEMIDLIST structure referenced by the pidl parameter.

pidl [in]

Type: PCUITEMID_CHILD

A pointer to an ITEMIDLIST structure that identifies the object relative to the folder specified in psf.

nFormat

Type: int

The format in which the data is being requested. This parameter must be set to one of the following values.

SHGDFIL_FINDDATA

Format used for file system objects. The pv parameter is the address of a WIN32_FIND_DATA structure.

SHGDFIL_NETRESOURCE

Format used for network resources. The pv parameter is the address of a NETRESOURCE structure.

SHGDFIL_DESCRIPTIONID

Version 4.71. Format used for network resources. The pv parameter is the address of an SHDESCRIPTIONID structure.

pv [out]

Type: void*

A pointer to a buffer that, when this function returns successfully, receives the requested data. The format of this buffer is determined by nFormat.

If nFormat is SHGDFIL_NETRESOURCE, there are two possible cases. If the buffer is large enough, the net resource's string information (fields for the network name, local name, provider, and comments) will be placed into the buffer. If the buffer is not large enough, only the net resource structure will be placed into the buffer and the string information pointers will be NULL.

cb

Type: int

Size of the buffer at pv, in bytes.

Return value

Type: HRESULT

Returns S_OK if successful, or E_INVALIDARG otherwise.

Remarks

This function extracts only information that is present in the pointer to an item identifier list (PIDL). Since the content of a PIDL depends on the folder object that created the PIDL, there is no guarantee that all requested information will be available. In addition, the information that is returned reflects the state of the object at the time the PIDL was created. The current state of the object could be different. For example, if you set nFormat to SHGDFIL_FINDDATA, the function might assign meaningful values to only some of the members of the WIN32_FIND_DATA structure. The remaining members will be set to zero. To retrieve complete current information on a file system file or folder, use standard file system functions such as GetFileTime or FindFirstFile.

E_INVALIDARG is returned if the psf, pidl, pv, or cb parameter does not match the nFormat parameter, or if nFormat is not one of the specific SHGDFIL_ values shown above.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 4.0 or later)

Unicode and ANSI names

SHGetDataFromIDListW (Unicode) and SHGetDataFromIDListA (ANSI)

 

 

Community Additions

ADD
Show:
© 2015 Microsoft