Advertisement
2002C Windows API Call/ Explanation #10823

Browse Folder Dialog

Have ever wondered if there is an ActiveX object that make you browse for a folder. This API functions calls make the browse dialog

AI

Podsumowanie 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.

Kod źródłowy
original-source
Private Sub Command1_Click()
   'Opens a Treeview control that displays the directories in a computer
  Dim lpIDList As Long     
  Dim sBuffer As String
  Dim szTitle As String     
  Dim tBrowseInfo As BrowseInfo
 szTitle = "This is the title"     
 With tBrowseInfo
  .hWndOwner = Me.hWnd         
  .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
Oryginalne komentarze (3)
Odzyskane z Wayback Machine