Da ich heute gute Laune habe:
Delphi-Quellcode:
function ListIniFiles(Box : TListbox) : Boolean;
var
LStrList: TStringlist;
LPfad: String;
LSearchRec: TSearchRec;
begin
LPfad := ExtractFilePath(ParamStr(0)) + '\unterverzeichnis_des_ordners\';
Box.Items.Clear;
LStrList := TStringlist.Create;
if FindFirst(LPfad + '*.ini', faAnyFile, LSearchRec) = 0 then
begin
repeat
if LSearchRec.Attr and faDirectory = 0 then
begin
Box.Items.Add(LSearchRec.Name);
end;
until FindNext(LSearchRec) <> 0;
FindClose(LSearchRec);
end;
LStrList.Free;
end;
Aufruf:
ListIniFiles(Listbox1);