Código
function GetShortFileName (const Arquivo : String) : String;
var
aTmp : array [0..255] of char;
begin
if GetShortPathName (PChar (Arquivo), aTmp, sizeof (aTmp) - 1) = 0 then
Result := Arquivo
else
Result := StrPas (aTmp);
end;
function GetLongFileName (const Arquivo : String) : String;
var
aInfo : TSHFileInfo;
begin
if SHGetFileInfo (PChar(Arquivo), 0, aInfo, sizeof (aInfo), SHGFI_DISPLAYNAME) <>0 then
Result := String (aInfo.szDisplayName)
else
Result := Arquivo;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009