procedure DFSFiles(filename:string);
var curfile:TSearchRec;
begin
ChDir(filename);
if (FindFirst(filename+'*.*',faAnyFile,curfile) = 0) then
begin
repeat
if ( ( (curfile.Attr and faDirectory)<>0 ) and (curfile.Name <> '.') and (curfile.Name <> '..') ) then
begin
DFSFiles( ExpandFileName(curfile.Name) + '\' );
end
else
begin
if not DirectoryExists( ExpandFileName(curfile.Name) ) then
begin
if ( pos( UpperCase(ExtractFileExt(curfile.Name)),Exts ) <> 0 ) then
frmMain.lstDFSFiles.Items.Append( ExpandFileName(curfile.Name) );
end;
end;
until (FindNext(curfile) <> 0);
FindClose(curfile);
end;
ChDir('..');
end;