|
-
Oct 31st, 2000, 08:28 PM
#1
Thread Starter
Lively Member
I know this may sound stupid, but does anyone know what component Windows Explorer uses for browsing the files? I have been looking all over for it in Visual Basic and C++, but nothing. I think it is named something like SysTreeView32 or something like that.
This is really important that I have this, so any help would be appreciated.
-
Oct 31st, 2000, 09:16 PM
#2
_______
<?>
Code:
'using the browser dialog box
'make a reference
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 Form_Load()
'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)
' <<< Add Your Code Here >>>
MsgBox sBuffer
End If
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 31st, 2000, 09:25 PM
#3
Thread Starter
Lively Member
Thanks for your reply, but I guess I wasn't being specific enough. Let me try to explain more.
What I need is the treeview control that is used in Open/Save dialog boxes to browse the folders and files.
I need this because I am making a program that uses that control. Thanks for your help.
-
Oct 31st, 2000, 09:55 PM
#4
Frenzied Member
CommonDialog Control?
Are you familiar with the CommonDialog Control? This could be what you need.
I use it when I want to open and/or save files from a VB application. It will also provide a pallatte for runtime user selection of colors.
I have it on my Toolbar in the design environment, and have forgotten exactly how I put it there. If you cannot figure it out, I think I can figure it out again and also provide some simple code which uses it.
I think MSDN library & VB help has something on CommonDialog Control.
Live long & prosper.
The Dinosaur from prehistoric era prior to computers.
Eschew obfuscation!
If a billion people believe a foolish idea, it is still a foolish idea!
VB.net 2010 Express
64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.
-
Oct 31st, 2000, 10:14 PM
#5
Thread Starter
Lively Member
Thanks Guv, for your reply
But I am ONLY looking for the treeview component that is contained INSIDE of the open/save dialog boxes. If anyone has an idea of how to implement JUST that control into an application, I would be most grateful.
-
Oct 31st, 2000, 11:22 PM
#6
I think you are going to have to pound on microsoft's door for a bit in hopes of them releasing it, because to my knowledge there is no one control that does that you would have to use a treeview and some serious code to do it. Let me know if I'm wrong.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|