Windows shell: need a good tutorial

hi
i'd like to create a folder listing using ListView & TreeView and i'd like it to look like Win-Explorer, for that i know i have to navigate through the shell namespace to list folders under my comptuer and get their icons... who can help me find a good tutorial for that ?

thx
hatembrAsked:
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.

CimperialiCommented:
Star vb ide, and choose vb Application Wizard as project type (if chooses does not appear on opening vb, choose new project, and then Vb Application Wizard)
At first question on profile, click Next
At second question, choose "Explorer Style" and give the project a better name than "project1".
If you do not need menus, deselect on third page all what you see...Foolow wizard to the end.
You will have the front end completely setup by wizard.
Then you can add code to navigate throug folders and files, which goal you can obtain using filesystemObject (add a reference in your project to "Microsoft Scripting Runtime").
The following example works with all files and folders of "C:\" disk.
You can change it to work with all disk and to manage picture, also (but this require a bit more job)...
Add this declaration at top of form1 (after option explicit clause):
Private Fso As Scripting.FileSystemObject

'...
'add this at form load event:
Dim folder As Scripting.folder
   'force form to show
   Me.Caption = "Please wait while loading..."
   Me.Show
   tvTreeView.Style = tvwTreelinesPlusMinusPictureText
   tvTreeView.LineStyle = tvwRootLines
   Set Fso = New Scripting.FileSystemObject
      Set folder = Fso.GetFolder("C:\")
      tvTreeView.Nodes.Add , , "C:\", "C:\"
      Call addFiles(folder)
      Call filltreview(folder)
   Set Fso = Nothing
   Me.Caption = "Load completed!"
'...
'Add these two private sub:
Private Sub filltreview(fldr As Scripting.folder)
Dim subFd As Scripting.folder
Dim fldrPath As String

On Error Resume Next
'************************
Debug.Print fldr.Name & " in " & fldr.Path
'*************************
For Each subFd In fldr.SubFolders
   tvTreeView.Refresh
   fldrPath = fldr.Path
   If Right(fldrPath, 1) <> "\" Then
      fldrPath = fldrPath & "\"
   End If
   tvTreeView.Nodes.Add fldrPath, tvwChild, fldrPath & subFd.Name & "\", subFd.Name
   If subFd.SubFolders.Count > 0 Then
      If Err.Number = 0 Then
         Call filltreview(subFd)
      Else
         Err.Clear
      End If
   End If
Next
End Sub
Private Sub addFiles(fldr As Scripting.folder)
Dim fl As Scripting.File
lvListView.ListItems.Clear
For Each fl In fldr.Files
   lvListView.ListItems.Add , fl.Name, fl.Name
   lvListView.Refresh
Next
End Sub
'add this at nodeclick event of your treeview
Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
Set Fso = New Scripting.FileSystemObject
   Call addFiles(Fso.GetFolder(Node.Key))
Set Fso = Nothing
End Sub
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
CleanupPingCommented:
Hi hatembr,
This old question (QID 20554487) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept Cimperiali's as Answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
Cleanup Volunteer
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
Visual Basic Classic

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.