Folder Browser
This is a Function which displays the Browse directory dialogue and returns a path as a string. Unlike the usual shell command, this code works even on machines without the Active Desktop or IE 5 installed.
AI
ملخص الذكاء الاصطناعي: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
كود المصدر
Public Function BrowseForFolder(lnghWndOwner As Long) As String
''Opens a Treeview control that displays the directories in a computer and Returns a String
Dim lpIDList As Long
Dim sBuffer As String
Dim szTitle As String
Dim tBrowseInfo As BrowseInfo
szTitle = "This is the title"
With tBrowseInfo
.hWndOwner = lnghWndOwner
.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)
End If
BrowseForFolder = sBuffer
End Function
التعليقات الأصلية (3)
مسترجع من Wayback Machine