Files Delphi

//www.dronymc.cjb.net
//drony@mynet.com
//icq:266148308
uses
ShellAPI;
function MrsGetFileType(const strFilename: string): string;
var
FileInfo: TSHFileInfo;
begin
FillChar(FileInfo, SizeOf(FileInfo), #0);
SHGetFileInfo(PChar(strFilename), 0, FileInfo, SizeOf(FileInfo), SHGFI_TYPENAME);
Result := FileInfo.szTypeName;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('File type is: ' + MrsGetFileType('c:\autoexec.bat'));
end;