PathUnExpandEnvStringsW function (shlwapi.h)
Replaces certain folder names in a fully qualified path with their associated environment string.
BOOL PathUnExpandEnvStringsW( LPCWSTR pszPath, LPWSTR pszBuf, UINT cchBuf );
A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to be unexpanded.
A pointer to a buffer that, when this method returns successfully, receives the unexpanded string. The size of this buffer must be set to MAX_PATH to ensure that it is large enough to hold the returned string.
The size, in characters, in the pszBuf buffer.
Returns TRUE if successful; otherwise, FALSE.
The following folder paths are replaced by their equivalent environment string.
|The All Users profile folder||%ALLUSERSPROFILE%|
|The current user's application data folder (Windows Vista and later only).||%APPDATA%|
|The system name||%COMPUTERNAME%|
|The Program Files folder||%ProgramFiles%|
|The system root folder||%SystemRoot%|
|The system drive letter||%SystemDrive%|
|The current user's profile folder||%USERPROFILE%|
The shlwapi.h header defines PathUnExpandEnvStrings 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.
|Minimum supported client||Windows 2000 Professional, Windows XP [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|DLL||Shlwapi.dll (version 5.0 or later)|