Solved

Need a Directory Browser

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

792 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