Kod: Tümünü seç
function FileGetLongName(const aFile: string): string;
var
aInfo: TSHFileInfo;
begin
if
SHGetFileInfo(pChar(aFile),0,aInfo,Sizeof(aInfo),SHGFI_DISPLAYNAME)<>0
then
Result:=StrPas(aInfo.szDisplayName)
else
Result:=aFile;
end;
{------------------------------------------------------------------------------}
function FileGetShortName(const aFile: string): string;
var
aTmp: array[0..255] of char;
begin
if GetShortPathName(pChar(aFile),aTmp,Sizeof(aTmp)-1)=0 then
Result:=aFile
else
Result:=StrPas(aTmp);
end;