Programación General > Visual Basic 6.0 e inferiores

 Re: GetOpenFileName , GetSaveFileName

<< < (2/2)

RadicalEd:
GRACIAS POR LA INFORMACION Brroz
ES DE MUCHA AYUDA PARA TODOS

Brroz:
Para Asa (y a quien interes, por supuesto):

Puedes obtener un cuadro de diálogo para seleccionar una carpeta mediante este código:


--- Código: Text --- Option Explicit Private Type BROWSEINFO    hOwner As Long    pidlRoot As Long    pszDisplayName As String    lpszTitle As String   ulFlags As Long   lpfn As Long   lParam As Long   iImage As LongEnd TypePrivate Declare Function SHGetPathFromIDList Lib &#34;shell32.dll&#34; Alias &#34;SHGetPathFromIDListA&#34; (ByVal pidl As Long, ByVal pszPath As String) As LongPrivate Declare Function SHBrowseForFolder Lib &#34;shell32.dll&#34; Alias &#34;SHBrowseForFolderA&#34; (lpBrowseInfo As BROWSEINFO) As Long Public Function SeleccionarPath(Byval HWnd as long, Byal Titulo as strinh) As string    Dim bInf As BROWSEINFO   Dim lRc As Long   Dim lPathID As Long   Dim sPath As String       If Titulo = &#34;&#34; Then Titulo = &#34;Recuperar vía de acceso&#34;   bInf.hOwner = hWnd   bInf.lpszTitle = Titulo   bInf.ulFlags = BIF_RETURNONLYFSDIRS   lngPathID = SHBrowseForFolder(bInf)   sPath = String(512, Chr(0))   lRc = SHGetPathFromIDList(lPathID, sPath)   If lRc &#62; 0 Then SeleccionarPath = Left(sPath, InStr(1, sPath, Chr(0)) - 1) End Function  
Abur.

Navegación

[0] Índice de Mensajes

[*] Página Anterior

Ir a la versión completa