1 out of 2 rated this helpful - Rate this topic

SHParseDisplayName function

Applies to: desktop apps only

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

HRESULT SHParseDisplayName(
  __in       LPCWSTR pszName,
  __in_opt   IBindCtx *pbc,
  __out      PIDLIST_ABSOLUTE *ppidl,
  __in       SFGAOF sfgaoIn,
  __out_opt  SFGAOF *psfgaoOut
);

Parameters

pszName [in]

Type: LPCWSTR

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

pbc [in, optional]

Type: IBindCtx*

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

ppidl [out]

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

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

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

Minimum supported server

Windows Server 2003

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll (version 6.0 or later)

See also

IShellFolder::GetAttributesOf
IShellFolder::ParseDisplayName
ITEMIDLIST
IBindCtx
SHGetPathFromIDList

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ