SHParseDisplayName function (shlobj_core.h)
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(
[in] PCWSTR pszName,
[in, optional] IBindCtx *pbc,
[out] PIDLIST_ABSOLUTE *ppidl,
[in] SFGAOF sfgaoIn,
[out, optional] SFGAOF *psfgaoOut
);
Parameters
[in] pszName
Type: LPCWSTR
A pointer to a zero-terminated wide string that contains the display name to parse.
[in, optional] pbc
Type: IBindCtx*
A bind context that controls the parsing operation. This parameter is normally set to NULL.
[out] 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.
[in] 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 SFGAO.
[out, optional] 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 SFGAO.
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
Requirement | Value |
---|---|
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) |