Hola delphiadictos!
Estaba intentando crear una función que mostrase las carpetas de una unidad local en un TreeView. Yo habia hecho esto para experimetar un poco:
Código Delphi
[-]
procedure LocalTreeListing(const Folder: String; Nodes: TTreeNodes);
var
SearchRec: TSearchRec;
i: Integer;
begin
Nodes.Clear;
SearchRec.ExcludeAttr := 32;
if FindFirst(IncludeTrailingPathDelimiter(Folder)+'*.*', faAnyFile,
SearchRec) = 0 then
repeat
if ((SearchRec.Attr and faDirectory) = faDirectory
and not faHidden) and ((SearchRec.Attr and faSysFile) <> faSysFile) then
Nodes.Add(nil,SearchRec.Name);
if (Nodes.Count > 0) and
((Nodes[Nodes.Count-1].Text = '.') or
(Nodes[Nodes.Count-1].Text = '..')) then
Nodes[Nodes.Count-1].Delete;
until FindNext(SearchRec) <> 0;
FindClose(SearchRec);
end;
Esto sólo inserta en el TreeView las carpetas de un directorio deseado y esto no me es suficiente.
No tengo ni la mas mínima idea de por donde empezar con la función recursiva, alguien me podria hechar una mano?