Network Neighborhood in Drive List Box ?? 
Author Message
 Network Neighborhood in Drive List Box ??

Milos,
 It is still in Beta, but check out Brad Martinez' FolderTreeView
control at www.mvps.org/ccrp  I have no idea how to cage one
of those, but you forgot to free your PIDL.
Neila
Quote:

>Subject: Network Neighborhood in DriveListBox

>Newsgroups: comp.lang.basic.visual

>Can someone shed some light on how I can get the network neighbourhood to

>appear in function in a drive list box.

>Or better yet - a way to get a browse for folder like this one below to
>appear on a form and not its own modal window:

>Option Explicit

>Private Const BIF_RETURNONLYFSDIRS = 1
>Private Const BIF_DONTGOBELOWDOMAIN = 2
>Private Const MAX_PATH = 260

>Private Declare Function SHBrowseForFolder Lib _
>"shell32" (lpbi As BrowseInfo) As Long

>Private Declare Function SHGetPathFromIDList Lib _
>"shell32" (ByVal pidList As Long, ByVal lpBuffer _
>As String) As Long

>Private Declare Function lstrcat Lib "kernel32" _
>Alias "lstrcatA" (ByVal lpString1 As String, ByVal _
>lpString2 As String) As Long

>Private Type BrowseInfo
>   hWndOwner As Long
>   pIDLRoot As Long
>   pszDisplayName As Long
>   lpszTitle As Long
>   ulFlags As Long
>   lpfnCallback As Long
>   lParam As Long
>   iImage As Long
>End Type
>Private Sub Command1_Click()
>'Opens a Browse Folders Dialog Box that displays the
>'directories in your computer
>Dim lpIDList As Long ' Declare Varibles
>Dim sBuffer As String
>Dim szTitle As String
>Dim tBrowseInfo As BrowseInfo

>szTitle = "Hello World. Click on a directory and " & _
>"it's path will be displayed in a message box"
>' Text to appear in the the gray area under the title bar
>' telling you what to do

>With tBrowseInfo
>   .hWndOwner = Me.hWnd ' Owner Form
>   .lpszTitle = lstrcat(szTitle, "")
>   .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
>End With

>lpIDList = SHBrowseForFolder(tBrowseInfo)

>If (lpIDList) Then
>   sBuffer = Space(MAX_PATH)
>   SHGetPathFromIDList lpIDList, sBuffer
>   sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
>   MsgBox sBuffer
>End If

>End Sub



Fri, 08 Mar 2002 03:00:00 GMT  
 Network Neighborhood in Drive List Box ??
Subject: Network Neighborhood in DriveListBox

Newsgroups: comp.lang.basic.visual

Can someone shed some light on how I can get the network neighbourhood to

appear in function in a drive list box.

Or better yet - a way to get a browse for folder like this one below to
appear on a form and not its own modal window:

Option Explicit

Private Const BIF_RETURNONLYFSDIRS = 1
Private Const BIF_DONTGOBELOWDOMAIN = 2
Private Const MAX_PATH = 260

Private Declare Function SHBrowseForFolder Lib _
"shell32" (lpbi As BrowseInfo) As Long

Private Declare Function SHGetPathFromIDList Lib _
"shell32" (ByVal pidList As Long, ByVal lpBuffer _
As String) As Long

Private Declare Function lstrcat Lib "kernel32" _
Alias "lstrcatA" (ByVal lpString1 As String, ByVal _
lpString2 As String) As Long

Private Type BrowseInfo
   hWndOwner As Long
   pIDLRoot As Long
   pszDisplayName As Long
   lpszTitle As Long
   ulFlags As Long
   lpfnCallback As Long
   lParam As Long
   iImage As Long
End Type
Private Sub Command1_Click()
'Opens a Browse Folders Dialog Box that displays the
'directories in your computer
Dim lpIDList As Long ' Declare Varibles
Dim sBuffer As String
Dim szTitle As String
Dim tBrowseInfo As BrowseInfo

szTitle = "Hello World. Click on a directory and " & _
"it's path will be displayed in a message box"
' Text to appear in the the gray area under the title bar
' telling you what to do

With tBrowseInfo
   .hWndOwner = Me.hWnd ' Owner Form
   .lpszTitle = lstrcat(szTitle, "")
   .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
End With

lpIDList = SHBrowseForFolder(tBrowseInfo)

If (lpIDList) Then
   sBuffer = Space(MAX_PATH)
   SHGetPathFromIDList lpIDList, sBuffer
   sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
   MsgBox sBuffer
End If

End Sub



Sat, 09 Mar 2002 03:00:00 GMT  
 Network Neighborhood in Drive List Box ??

Thanks Neila,
I definitely will check it out

Quote:
> Milos,
>  It is still in Beta, but check out Brad Martinez' FolderTreeView
> control at www.mvps.org/ccrp  I have no idea how to cage one
> of those, but you forgot to free your PIDL.
> Neila



Tue, 12 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Network Neighborhood in Drive List Box?

2. Network drives in a drive list box control

3. VB6 - file list box / drive box question - resolving network paths and computer names

4. Drive control that shows Network Neighborhood

5. Treeview with Drives / Network Neighborhood

6. File List Box Problem on Network Drives

7. file list box problem across network drives

8. list network neighborhood

9. API to see the list of computers in Network Neighborhood

10. List Contents of Network Neighborhood

11. API to get list of Computers in Network Neighborhood

12. List Contents of Network Neighborhood

 

 
Powered by phpBB® Forum Software