Habs rausgefunden...
Delphi-Quellcode:
procedure DirectorySearch(ADirectory: string; AMask: String);
var
SR: TSearchRec;
begin
if FindFirst(ADirectory + '*.*', faDirectory, SR)=0 then
begin
repeat
if (SR.Attr and faDirectory = faDirectory) and (sr.Name<>'.') and (sr.Name<>'..') then
with form1 do begin
AdvSmoothListBox1.Items.Add.Caption:=(sr.Name);
AdvSmoothListBox1.Items.Sort;
end;
until FindNext(SR)<>0;
FindClose(SR);
end;
end;
procedure ExeSearch(ADirectory: String);
var
SR: TSearchRec;
begin
if FindFirst('.\SUCHORDNER\' + ADirectory + '\*.exe', faAnyFile, SR)=0 then
begin
repeat
with form1 do begin
ListBox1.Items.Add(sr.Name);
end;
until FindNext(SR)<>0;
FindClose(SR);
end;
end;
der fehler war in der ExeSearch... ich musste noch den SUCHORDNER angeben anstelle von '.\'... sorry!!
und nochmal der rest für die nachwelt
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
var
i:integer;
begin
DirectorySearch('.\SUCHORDNER\','*.*');
for i := 0 to AdvSmoothListBox1.Items.Count-1 do
begin
ExeSearch(AdvSmoothListBox1.Items[i].Caption);
end;
end;