Function GetShortFileName(Const FileName : String) : String; var aTmp: array[0..255] of char;begin if GetShortPathName(PChar(FileName),aTmp,Sizeof(aTmp)-1)=0 thenResult:= FileNameelseResult:=StrPas(aTmp);end; Function GetLongFileName(Const FileName : String) : String; var aInfo: TSHFileInfo;begin if SHGetFileInfo(PChar(FileName),0,aInfo,Sizeof(aInfo),SHGFI_DISPLAYNAME)<>0 thenResult:= String(aInfo.szDisplayName)elseResult:= FileName;end; |