SHGetPathFromIDListEx function (shlobj_core.h)

Converts an item identifier list to a file system path. This function extends SHGetPathFromIDList by allowing you to set the initial size of the string buffer and declare the options below.

Syntax

BOOL SHGetPathFromIDListEx(
  [in]  PCIDLIST_ABSOLUTE pidl,
  [out] PWSTR             pszPath,
        DWORD             cchPath,
        GPFIDL_FLAGS      uOpts
);

Parameters

[in] pidl

Type: PCIDLIST_ABSOLUTE

A pointer to an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop).

[out] pszPath

Type: PWSTR

When this function is called it is passed a null-terminated, Unicode buffer to receive the file system path. This buffer is of size cchPath.

When this function returns, contains the address of a null-terminated, Unicode buffer that contains the file system path. This buffer is of size cchPath.

cchPath

Type: DWORD

The size of the buffer pointed to by pszPath, in characters.

uOpts

Type: GPFIDL_FLAGS

These flags determine the type of path returned.

GPFIDL_DEFAULT (0x0000)

Win32 file names, servers, and root drives are included.

GPFIDL_ALTNAME (0x0001)

Uses short file names.

GPFIDL_UNCPRINTER (0x0002)

Include UNC printer names items.

Return value

Type: BOOL

Returns TRUE if successful; otherwise, FALSE.

Remarks

Except for UNC printer names, if the location specified by the pidl parameter is not part of the file system, this function fails.

If the pidl parameter specifies a shortcut, the pszPath contains the path to the shortcut, not to the shortcut's target.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
Library Shell32.lib
DLL Shell32.dll
API set ext-ms-win-shell-shell32-l1-2-2 (introduced in Windows 10, version 10.0.14393)

See also

SHParseDisplayName