Combobox populated with directory tree.

I’m currently working on an application that has a combobox that is populated manually to display the file structure of the local system. It basically resembles an explorer style drop down. The problem is since this is a manually populated listing we load each special folder using SHGetSpecialFolderPath() to get the specific folders we need. In the end we always populate the outline below:

Desktop
My Computer
<drive C:>
<drive D:>
<mapped drive Q:>
Shared Documents
My Documents
My Pictures

After we hash out these files we have another function that loops through and finds the folder or drive that matches the current folder selected on the combobox then we will in the subfolders below the selected folder:

Example: system folder is selected from C:\Windows\System32

Desktop
My Computer
<drive C:>
      Windows
            System32
<drive D:>
<mapped drive Q:>
Shared Documents
My Documents
My Pictures

The problem is we’ve run into a situation where mapping unmapped drives is causing sporadic results as we’re manually creating these directories by hand and adding them into the combobox.

Is there a way that we can tie something similar to the browsing capability of LPITEMIDLIST into a combobox? Every available suggestion has been to bring up a dialog box for the user to select but we have one available and wish to incorporate the same functionality into a combobox. If anyone can please advise me on how to go about doing this or any suggestions? Seems to me there should be an easy way to create a combobox that maps to all the available system folders and networked drives but I can’t seem to find anything. Help is very much appreciated!.
RampidByterAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jkrCommented:
Oh, and if you should use MFC, 'CWnd' has teh corresponding member functions.
0
RampidByterAuthor Commented:
After taking a look at what you provided it is sort of what I’m looking for but not exactly. Currently when you click on my combo box is displays the same style of information as you would with a pidl while browsing for a file but does not support unmapped drives. The combo dialog options were extremely limited as far as what I found. You must specify a path that is only fills the subdirectories for that particular path. The way the combo box needs to be is it gets a path and shows the sub directories for that path in relationship to the already existing directory structure I mentioned previously. Is there any alternative ways to displaying an explorer style listing of the

What im going for is something similar to setting up BROWSEINFO with the information populated from the SHGetSpecialFolderLocat().

SHGetSpecialFolderLocation(hWnd, CSIDL_DESKTOP, &pidlRoot);

Any suggestions?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

jkrCommented:
That should work if you you use 'ShGetSpecialFolderPath(...,CSIDL_DESKTOP,...)' to obtain the 'lpPathSpec'
0
RampidByterAuthor Commented:
Could you show me a snippet of what this would look like in relationship to the combo box control? If you're correct then I think you've answered my questions!
0
RampidByterAuthor Commented:
I was looking into it though and if i use a virtual path, which is what I need to do that it will fail when calling that function.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.