function myGetFileSize(const FileName: string): LongInt;<br>var<br> f : TSearchRec ;<br>begin<br> if FindFirst(FileName, faAnyFile, f) = 0 then<br> Result := f.Size<br> else<br> Result := 0;<br> SysUtils.FindClose(f) ; { de-allocates resources eaten by FindFirst }<br>end;<br>function fileTypeName(const aFile: String): String;<br>var<br> aInfo: TSHFileInfo;<br>begin<br> if SHGetFileInfo(PChar(aFile),0,aInfo,Sizeof(aInfo),SHGFI_TYPENAME)<>0 then<br> Result:=StrPas(aInfo.szTypeName)<br> else begin<br> Result:=ExtractFileExt(aFile);<br> Delete(Result,1,1);<br> Result:=strUpper(Result)+' File';<br> end;<br>end;