Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use TreeControl?

Status
Not open for further replies.

Sathyavady

Programmer
Apr 4, 2003
25
IN

Friends...
Can u help how to use the tree control to display the drives and directories of my computer.I want to get the path of the files,when i click on the nodes.
Thankz ...
Sathyan
 
>> but how can I use this as a part of my parent dialog.?

Simply make a tree control in the dialog editor, in Classwizard add a control mapping variable (of type CTreeCtrl). Then you can invoke methods on your CTreeCtrl member variable.

>> and how is it possible to get all file paths in a selected folder?

This code is a bit complicated, unfortunately I'm to lazy to write it for you.. But basically it involves finding all the folders in the root directory. Then for each folder in the root directory, find all its subfolders. Then find all the subfolders of each subfolder, etc.

A recursive function might help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top