ShellTreeView (or) Other, You decide

Hello All;

   Is their a way in a ShellTreeView to display Only
The Folder that are located in the Main Folder of the program?

Example:
   The program is installed in:
 
   C:\Program Files\My Program\
   Sub Folders in the [My Program] folder are:
 
   My Utilities | My Pictures | My Personal | My What Ever Else.
{ so on, and on }

   Is their a way to make the Shell only show what is contained in
[My Program] Folder. And not the entire computer.
And no way to browse outside of the [My Program] folder?

Thank You
Carrzkiss
LVL 31
Wayne BarronAuthor, Web DeveloperAsked:
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.

Wim ten BrinkSelf-employed developerCommented:
Wouldn't you have to assign the root for this?

Checking...

Yep. Assign 'C:\Program Files\My Program' to the ShellTreeView.Root and all you see is every folder with this one as root... And use ExtractFilePath(ParamStr(0)) to set the folder of your application as root.
0

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
Wayne BarronAuthor, Web DeveloperAuthor Commented:
how would this be accomplished if say.
The user was to install the program into

D:\My Program\....
Or
E:\Program Files\My Program

And so forth.
  Is there a way to code it to where it will pick up on any Root?
Depending on User-Install prefrence?

Can you Alex, or someone make a example up of something like this?

Thanks
Carrzkiss
0
DragonSlayerCommented:
In that case, you need to find the folder of the .exe:

ShellTreeView1.Root := ExtractFilePath(ParamStr(0));

* Alex should get the point for pointing out the Root property
0
Wayne BarronAuthor, Web DeveloperAuthor Commented:
Thank you both [Alex & Slayer];

  I added it in like so:

OnCreate;
ShellTreeView1.Root := ExtractFilePath(ParamStr(0));
end;

  Works.
1 more question right quick, just to let me know if this is suppose to do it.

  This is the way that the folder is going right now, to the sample project that I just tested it on, as a quicky.

  E:\Delphi Codes\Project\Project.exe file here with codes of course.

When program opens it shows this
   Delphi Codes  <-- Main Folder
      Test                <-- A test folder a made

Now in the [Delphi Codes] Folder itself their is about 15 other folder
But they are not shown.

   So this is my question:?

   Is it suppose to show the Main Supporting folder.
   And have it as your main?
Like in my case it is the [Delphi Codes] Folder

Thanks guys.
I will split the points, because you both helped.

Carrzkiss
0
Wayne BarronAuthor, Web DeveloperAuthor Commented:
never mind.
I just re-read Alex's post, and he states
[you see is every folder with this one as root]

So that answers my question.

Take Care Guys.

Carrzkiss
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
Delphi

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.