Gracias maeyanes, me has ayudado a depurar el código de mi procedimiento, pero la verdad es que este código hace exactamente lo mismo que hacia el mio, le he hecho unas modificaciones y se ha quedado así, pero sigue haciendo lo mismo que el mio...
Gracias de todas formas...
Código Delphi
[-]
procedure TreeListing(const Folder: string; Nodes: TTreeNodes;
ParentNode: TTreeNode);
var
AFolder: TSearchRec;
NewNode: TTreeNode;
begin
if FindFirst(IncludeTrailingPathDelimiter(Folder) + '*.*', faDirectory, AFolder) = 0 then
repeat
if ((AFolder.Attr and faDirectory) = faDirectory) and
((AFolder.Attr and faSysFile) <> faSysFile) and
(AFolder.Name <> '.') and (AFolder.Name <> '..') then
begin
NewNode := Nodes.Add(ParentNode, AFolder.Name);
TreeListing(IncludeTrailingPathDelimiter(CurrLocalPath+AFolder.Name) +
'*.*', Nodes, NewNode);
end;
until
FindNext(AFolder) <> 0;
FindClose(AFolder);
end;