ImageEn, unit iexWindowsFunctions

GetWindowsFileTypeName

GetWindowsFileTypeName

Declaration

function GetWindowsFileTypeName(const FileName: string; DefToExt: Boolean = False): string;

Description

Calls ShGetFileInfo to return the Windows type for a file or folder (SHGFI_TYPENAME), e.g. 'Microsoft Word Document'
If DefToExt = False and the operation fails (e.g. for files that cannot be accesses), the result will be ''.
If DefToExt = True, it will default to "EXT File"

Example

// Get windows file type name
lblFileType.Caption := GetWindowsFileTypeName( 'D:\Image.jpeg' );