| ImageEn, unit iexWindowsFunctions |
|
GetWindowsFileDisplayName
GetWindowsFileDisplayName
Declaration
function GetWindowsFileDisplayName(const FileName: string): string;
Description
Calls ShGetFileInfo to return the display name for a file or folder (SHGFI_DISPLAYNAME), e.g. the Windows document folder would return 'Documents' (or the localized equivalent).
Result is '' if the operation failed.
For folders, if there is not a system name (e.g. "Pictures" or "Documents"), just the folder name is returned. For files, it will be just the filename with or without an extension (depending on whether "File name extensions" is enabled in File Explorer).
Example
// Get windows file display name
lblName.Caption := GetWindowsFileDisplayName( 'C:\Users\Default\Documents\' );