Solved

Need a Directory Browser

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 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