Muchas Gracias a los 2 por responder, estoy contento lo he conseguio
No se nada de Api, pero me ha salido, asi Funciona:
Gracias y Saludos
No se nada de Api, pero me ha salido, asi Funciona:
Código [Seleccionar]
Private Type BrowseInfo
hWndOwner As Long
pidlRoot As Long
sDisplayName As String
sTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
'Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SHBrowseForFolder Lib "Shell32.dll" (bBrowse As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "Shell32.dll" (ByVal lItem As Long, ByVal sDir As String) As Long
'Add an editbox to the dialog: SHELL 5.0 or later only!
Private Const BIF_EDITBOX As Long = &H10
'insist on valid result (or CANCEL)
Private Const BIF_NEWDIALOGSTYLE As Long = &H40
Private Const BIF_USENEWUI As Long = (BIF_NEWDIALOGSTYLE Or BIF_EDITBOX)
Private Function BrowseForDirectory() As String
Dim browse_info As BrowseInfo
Dim item As Long
Dim dir_name As String
browse_info.hWndOwner = hwnd
browse_info.pidlRoot = 0
browse_info.sDisplayName = Space$(260)
browse_info.sTitle = "Selecionar una Carpeta"
browse_info.ulFlags = 1 ' devuelve el nombre del directorio.
browse_info.lpfn = 0
browse_info.lParam = 0
browse_info.iImage = 0
browse_info.ulFlags = BIF_USENEWUI Or BIF_RETURNONLYFSDIRS
item = SHBrowseForFolder(browse_info)
If item Then
dir_name = Space$(260)
If SHGetPathFromIDList(item, dir_name) Then
BrowseForDirectory = Left(dir_name, _
InStr(dir_name, Chr$(0)) - 1)
Else
BrowseForDirectory = ""
End If
End If
End Function
Private Sub Command3_Click()
sRutaBrowserFolder = BrowseForDirectory
End Sub
Gracias y Saludos