Как мне преобразовать "Long File Name.pas" в "longfi~1.pas"?
Попробуйте эти процедуры:
Function GetShortFileName(Const FileName : String) : String; var aTmp: array[0..255] of char;
beginif GetShortPathName(PChar(FileName),aTmp,Sizeof(aTmp)-1)=0 then
Result:= FileName
else
Result:=StrPas(aTmp);
end;Function GetLongFileName(Const FileName : String) : String; var aInfo: TSHFileInfo;
beginif SHGetFileInfo(PChar(FileName),0,aInfo,Sizeof(aInfo),SHGFI_DISPLAYNAME)<>0 then
Result:= String(aInfo.szDisplayName)
else
Result:= FileName;
end;
|