Unit Unit1;
Interface
Uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
Type
TForm1 = class(TForm)
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
End;
Procedure FindAll (const Path: String;
Attr: Integer;
List: TStrings);
Var
Form1: TForm1;
Implementation
{$R *.dfm}
Procedure FindAll (const Path: String;
Attr: Integer;
List: TStrings);
Var
Res: TSearchRec;
EOFound: Boolean;
Begin
EOFound:= False;
If FindFirst(Path, Attr, Res) < 0 then
exit
Else
while not EOFound do begin
List.Add(Res.Name);
EOFound:= FindNext(Res) <> 0;
End;
FindClose(Res);
End;
Procedure TForm1.FormCreate(Sender: TObject);
Begin
FindAll('C:\*.*',faAnyFile,Listbox1.Items);
End;
End.