This topic has not yet been rated - Rate this topic

SHGetPathFromIDListEx function

Applies to: desktop apps only

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

pidl [in]

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).

pszPath [out]

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Shlobj.h

Library

Shell32.lib

DLL

Shell32.dll

See also

SHParseDisplayName

 

 

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