ILCreateFromPathA function (shlobj_core.h)

Returns the ITEMIDLIST structure associated with a specified file path.

Syntax

PIDLIST_ABSOLUTE ILCreateFromPathA(
  [in] PCSTR pszPath
);

Parameters

[in] pszPath

Type: PCTSTR

A pointer to a null-terminated Unicode string that contains the path. This string should be no more than MAX_PATH characters in length, including the terminating null character.

Return value

Type: PIDLIST_ABSOLUTE

Returns a pointer to an ITEMIDLIST structure that corresponds to the path.

Remarks

Call ILFree to release the ITEMIDLIST when you are finished with it.

Note

The shlobj_core.h header defines ILCreateFromPath 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 Server 2003 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h, Shlobj_core.h, Shlobj.h, Shlobj_core.h)
Library Shell32.lib
DLL Shell32.dll (version 5.0 or later)
API set ext-ms-win-shell-shell32-l1-2-1 (introduced in Windows 10, version 10.0.10240)