Solved

Need a Directory Browser

Posted on 2002-05-17
4
135 Views
Last Modified: 2010-05-02
I am looking for a good directory browser. I have seen the ones at http://www.experts-exchange.com/questions/Q.20111547.html. However, I could never get any of these to browse the network. The network icon was in the tree but it would never show any of the workstations. Anyway, I would like one that provides a way for you to make a new folder. Willing to purchase one if necessary.

Thanks
0
Comment
Question by:EEI
4 Comments
 
LVL 2

Expert Comment

by:ventond
ID: 7017845
Why not use the Microsoft Windows Common Dialog Control?
It ships with windows and it's free.
0
 
LVL 12

Accepted Solution

by:
jgv earned 100 total points
ID: 7017851
I tried out the demo that comes with this, looks like it should do what you want.

http://www.mvps.org/ccrp/controls/ccrpbdsvr6.htm
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7017924
Why don't you use browse for folder as Windows does?
' you culd modify to return last backslash or not:

Option Explicit
'--------------------------------------------------------------
' Copyright ©1996-2001 VBnet, Randy Birch, All Rights Reserved.
' Terms of use http://www.mvps.org/vbnet/terms/pages/terms.htm
'--------------------------------------------------------------


Public Type BROWSEINFO
  hOwner           As Long
  pidlRoot         As Long
  pszDisplayName   As String
  lpszTitle        As String
  ulFlags          As Long
  lpfn             As Long
  lParam           As Long
  iImage           As Long
End Type

Public Const BIF_RETURNONLYFSDIRS = &H1
Public Const BIF_DONTGOBELOWDOMAIN = &H2
Public Const BIF_STATUSTEXT = &H4
Public Const BIF_RETURNFSANCESTORS = &H8
Public Const BIF_BROWSEFORCOMPUTER = &H1000
Public Const BIF_BROWSEFORPRINTER = &H2000
Public Const MAX_PATH = 260

Public Declare Function SHGetPathFromIDList _
  Lib "shell32.dll" Alias "SHGetPathFromIDListA" _
 (ByVal pidl As Long, _
  ByVal pszPath As String) As Long

Public Declare Function SHBrowseForFolder Lib "shell32.dll" _
  Alias "SHBrowseForFolderA" _
 (lpBrowseInfo As BROWSEINFO) As Long

Public Declare Sub CoTaskMemFree Lib "ole32.dll" _
  (ByVal pv As Long)



Public Function BrwFolder() As String

 Dim bi As BROWSEINFO
 Dim pidl As Long
 Dim path As String
 Dim pos As Integer

'Fill the BROWSEINFO structure with the
'needed data. To accomodate comments, the
'With/End With sytax has not been used, though
'it should be your 'final' version.

'hwnd of the window that receives messages
'from the call. Can be your application
'or the handle from GetDesktopWindow().
 bi.hOwner = 0 'Me.hWnd

'Pointer to the item identifier list specifying
'the location of the "root" folder to browse from.
'If NULL, the desktop folder is used.
 bi.pidlRoot = 0&

'message to be displayed in the Browse dialog
 bi.lpszTitle = "Select your Folder"

'the type of folder to return.
 bi.ulFlags = BIF_RETURNONLYFSDIRS
 
'show the browse for folders dialog
 pidl = SHBrowseForFolder(bi)

'the dialog has closed, so parse & display the
'user's returned folder selection contained in pidl
 path = Space$(MAX_PATH)
   
 If SHGetPathFromIDList(ByVal pidl, ByVal path) Then
    pos = InStr(path, Chr$(0))
    BrwFolder = Left$(path, pos - 1) & "\"
 End If

 Call CoTaskMemFree(pidl)
 
End Function

To create a new folder, just use mkdir function.
0
 

Author Comment

by:EEI
ID: 7018106
Thanks igv, that is perfect. It is exactly what I was looking for!

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now