Scroll im oben verlinken Thread mal runter. Da findest Du den (meinen) Code, den alcaeus gemeint hat, auch.
Guckst Du:
Delphi-Quellcode:
procedure FileList(const APath, AExt: string; ARecurse: Boolean;
AList: TStrings);
var
F : TSearchRec;
Path : string;
begin
Path := IncludeTrailingPathDelimiter(APath); // nur für Delphi 4 und höher!
if (ARecurse) and
(FindFirst(Path + '*.*', faAnyFile, F) = 0) then
try
repeat
if (F.Name <> '.') and (F.Name <> '..') and
((F.Attr and faDirectory) = faDirectory) then
FileList(Path + F.Name, AExt, ARecurse, AList);
until FindNext(F) <> 0;
finally
FindClose(F);
end;
if FindFirst(Path + AExt, faAnyFile, F) = 0 then
try
repeat
if (F.Name <> '.') and (F.Name <> '..') and
((F.Attr and faDirectory) <> faDirectory) then
AList.Add(Path + F.Name);
until FindNext(F) <> 0;
finally
FindClose(F);
end;
mfG
mirage228