Hola no me doy cuenta como ordenar por fecha de creacion en un listbox los archivos de directorio. Copio lo que fui haciendo y encontrando, funciona bien pero no ordena. Gracias.
Código Delphi
[-]
if DirectoryExists(carpeta) then
ListBox1.Items := ListaArchivos(carpeta+'*.pdf');
Código Delphi
[-]
function ListaArchivos(directorioPadre: string) : TStringList;
var
sr: TSearchRec;
begin
Result := TStringList.Create;
if FindFirst(directorioPadre + '*', faAnyFile, sr) = 0 then
repeat
if (sr.Attr and faDirectory = 0) or (sr.Name <> '.')
and (sr.Name <> '..') then
Result.Add( sr.Name);
until FindNext(sr) <> 0;
FindClose(sr);
end;