1 2 //This code will get the description of a file 3 #include <Shellapi.h> 4 5 String TForm1::GetFileType(String sFile){ 6 7 TSHFileInfo FileInfo; 8 SHGetFileInfo(sFile.c_str(), 0, &FileInfo, sizeof(FileInfo), SHGFI_TYPENAME); 9 return FileInfo.szTypeName; 10 11 } 12 13 void __fastcall TForm1::Button1Click(TObject *Sender) 14 { 15 String sData; 16 sData = GetFileType("C:\\autoexec.bat"); 17 ShowMessage(sData); 18 19 20 }