Advertisement
5_2007-2008 Windows API Call/ Explanation #175353

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

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.

소스 코드
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
Upload
원본 댓글 (3)
Wayback Machine에서 복구됨