What you want to do is walk the directory tree, making a list. The algorithm is roughly as follows:
Code:
To walk a tree:
Clear the list of folders and the list of files
Walk the folder at the root of the tree
To walk a folder:
For each file or folder inside the folder:
If the found object is a folder:
Add the found object to the list of folders
Walk the found object
Else:
If the found object is a file of a desirable type:
Add the found object to the list of files
What FindxFile lets you do is "For each file or folder inside the folder". "Clear" and "add" are methods of your programming environment's list container, whether it be an array list or a linked list, or whether it be whether it be a C++ STL list, a list in the standard library of any other language, or a custom list. The rest is
recursion.