SHParseDisplayName function

Translates a Shell namespace object's display name into an item identifier list and returns the attributes of the object. This function is the preferred method to convert a string to a pointer to an item identifier list (PIDL).

Syntax

SHSTDAPI SHParseDisplayName(
  PCWSTR           pszName,
  IBindCtx         *pbc,
  PIDLIST_ABSOLUTE *ppidl,
  SFGAOF           sfgaoIn,
  SFGAOF           *psfgaoOut
);

Parameters

pszName

Type: LPCWSTR

A pointer to a zero-terminated wide string that contains the display name to parse.

pbc

Type: IBindCtx*

A bind context that controls the parsing operation. This parameter is normally set to NULL.

ppidl

Type: PIDLIST_ABSOLUTE*

The address of a pointer to a variable of type ITEMIDLIST that receives the item identifier list for the object. If an error occurs, then this parameter is set to NULL.

sfgaoIn

Type: SFGAOF

A ULONG value that specifies the attributes to query. To query for one or more attributes, initialize this parameter with the flags that represent the attributes of interest. For a list of available SFGAO flags, see IShellFolder::GetAttributesOf.

psfgaoOut

Type: SFGAOF*

A pointer to a ULONG. On return, those attributes that are true for the object and were requested in sfgaoIn are set. An object's attribute flags can be zero or a combination of SFGAO flags. For a list of available SFGAO flags, see IShellFolder::GetAttributesOf.

Return Value

Type: HRESULT

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

Remarks

You should call this function from a background thread. Failure to do so could cause the UI to stop responding.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
Library Shell32.lib
DLL Shell32.dll (version 6.0 or later)

See Also

IBindCtx

IShellFolder::GetAttributesOf

IShellFolder::ParseDisplayName

ITEMIDLIST

SHGetPathFromIDList