Visualizzazione dei risultati da 1 a 10 su 10

Discussione: [VB] SHBrowseForFolder

  1. #1
    Utente di HTML.it L'avatar di rambco
    Registrato dal
    Aug 2001
    Messaggi
    582

    [VB] SHBrowseForFolder

    Come faccio a far comparire il pulsante nuova cartella quando apro la scelta della directory ?

  2. #2
    Forse con le API fai qualcosa, ma non so dirti di più, al momento...

    SORRY! :quipy:

  3. #3
    Utente di HTML.it L'avatar di rambco
    Registrato dal
    Aug 2001
    Messaggi
    582

    .

    nessuno sa qualche cosa ?

  4. #4
    Utente di HTML.it L'avatar di biste
    Registrato dal
    Apr 2001
    Messaggi
    877
    Prova questo....

    codice:
    Private Type BrowseInfo
        hWndOwner As Long
        pIDLRoot As Long
        pszDisplayName As Long
        lpszTitle As Long
        ulFlags As Long
        lpfnCallback As Long
        lParam As Long
        iImage As Long
    End Type
    Const BIF_RETURNONLYFSDIRS = 1
    Const BIF_USENEWUI = &H40
    Const MAX_PATH = 260
    Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal hMem As Long)
    Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long
    Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
    Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long
    Private Sub Form_Load()
        Dim iNull As Integer, lpIDList As Long, lResult As Long
        Dim sPath As String, udtBI As BrowseInfo
        With udtBI
            .hWndOwner = Me.hWnd
            .lpszTitle = lstrcat("C:\", "")
            .ulFlags = BIF_USENEWUI + BIF_RETURNONLYFSDIRS
        End With
        lpIDList = SHBrowseForFolder(udtBI)
        If lpIDList Then
            sPath = String$(MAX_PATH, 0)
            SHGetPathFromIDList lpIDList, sPath
            CoTaskMemFree lpIDList
            iNull = InStr(sPath, vbNullChar)
            If iNull Then
                sPath = Left$(sPath, iNull - 1)
            End If
        End If
    End Sub

  5. #5
    Utente di HTML.it L'avatar di rambco
    Registrato dal
    Aug 2001
    Messaggi
    582

    oki

    funzia tnx !

  6. #6
    Utente di HTML.it L'avatar di biste
    Registrato dal
    Apr 2001
    Messaggi
    877
    nad@ prg
    :tongue:

  7. #7
    Sapete per caso come si fa ad impostare la directory iniziale?
    Riccardo

  8. #8

  9. #9
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    2,894
    LO SAPEVATE CHE C'E' UN FORMU APPOSTA PER VISUAL BASIC...

  10. #10
    Utente di HTML.it L'avatar di biste
    Registrato dal
    Apr 2001
    Messaggi
    877
    lo sai ke questo thread è iniziato il 25-03-2002?
    Non esisteva ancora il sottoforum di vb
    UGIdotNET
    Microsoft .NET MCAD
    C++, C#, VB6, VB.NET, ASP, ASP.NET
    SQL Server 2000

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.