Code: procedure ScanDir(Dir: string); var hFind: THandle; FD: TWIN32FindData; begin hFind:= FindFirstFile(PChar(Dir + '\*.*'), FD); if (hFind <> INVALID_HANDLE_VALUE) then try repeat if (FD.dwFileAttributes and faDirectory) <> 0 then [COLOR=DarkRed]Form1.ListBox1.Items.Add(FD.cFileName);[/COLOR] until not FindNextFile(hFind,FD); finally Windows.FindClose(hFind); end; end; procedure TForm1.Button1Click(Sender: TObject); begin ScanDir('c:\'); end;
самому-то подумать сложно? все же просто: Code: ............. hFind:= FindFirstFile(PChar(Dir + '\*.*'), FD); if (hFind <> INVALID_HANDLE_VALUE) then begin repeat if (FD.cFileName<>String('.')) and (FD.cFileName <> '..') then begin if (FD.dwFileAttributes and faDirectory) <> 0 then .............