Solved

Need a Directory Browser

Posted on 2002-05-17
4
134 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 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

19 Experts available now in Live!

Get 1:1 Help Now