Επεξεργασία

Κοινή χρήση μέσω


SHGetPathFromIDListW function (shlobj_core.h)

Converts an item identifier list to a file system path.

Syntax

BOOL SHGetPathFromIDListW(
  [in]  PCIDLIST_ABSOLUTE pidl,
  [out] LPWSTR            pszPath
);

Parameters

[in] pidl

Type: PCIDLIST_ABSOLUTE

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

[out] pszPath

Type: LPTSTR

The address of a buffer to receive the file system path. This buffer must be at least MAX_PATH characters in size.

Return value

Type: BOOL

Returns TRUE if successful; otherwise, FALSE.

Remarks

If the location specified by the pidl parameter is not part of the file system, this function will fail.

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

Note

The shlobj_core.h header defines SHGetPathFromIDList as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

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

See also

SHGetPathFromIDListEx

SHParseDisplayName