[TRUCO DELPHI] Nombres de Archivos Cortos y Largos.
delphi
function GetShortFileName(const FileName : string) : string; var aTmp: array[0..255] of char; begin if 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; begin if SHGetFileInfo(PChar(FileName),0,aInfo,Sizeof(aInfo),SHGFI_DISPLAYNAME)<>0 then Result:= string(aInfo.szDisplayName) else Result:= FileName; end;
Saludos!