select folder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ranesmitas
    New Member
    • Sep 2007
    • 21

    select folder

    hi i want to select folder in code so i did some code i.e
    [code=vb]
    Private Const BIF_RETURNONLYF SIDIRS = 1
    Private Const BIF_DONTGOBELOW DOMAIN = 2
    Private Const MAX_PATH = 260


    Private Declare Function SHBROWSERFORFOL DER Lib "shell32" (lpbi As BrowsInfo) As Long
    Private Declare Function SHGETPATHFROMID LIST Lib "shell32" (ByVal PIDLIST As Long, ByVal LPBUFFER As String) As Long
    Private Declare Function LSTRCAT Lib "Kernel32" Alias "lstrcatA" (ByVal LPSTRING1 As String, ByVal LPSTRING2 As String) As Long

    Private Type BrowsInfo
    hWndOwner As Long
    pIDLRoot As Long
    pSZDisplayName As Long
    lPSZTitle As Long
    ulFlags As Long
    lpfn_call_back As Long
    lparam As Long
    iImage As Long
    End Type
    Private Sub browser()
    On Error Resume Next
    Dim lpidlist As Long
    Dim sbuffer As String
    Dim sztitle As String
    Dim tbrowseinfo As BrowsInfo

    sztitle = "Compress and encrypt files(s) in folder"

    With tbrowseinfo
    .hWndOwner = Me.hWnd
    .lPSZTitle = LSTRCAT(sztitle , " ")
    .ulFlags = BIF_RETURNONLYF SIDIRS + BIF_DONTGOBELOW DOMAIN
    End With

    lpidlist = SHBROWSERFORFOL DER(tbrowseinfo )

    If (lpidlist) Then
    sbuffer = Space(MAX_PATH)
    SHGETPATHFROMID LIST lpidlist, sbuffer
    sbuffer = Left(sbuffer, InStr(sbuffer, vbnullclear) - 1)
    txtpath.Text = sbuffer
    If txtpath.Text = " " Then
    Exit Sub
    End If
    End If


    End Sub


    Private Sub cmdselect_Click ()
    On Error GoTo cmdserr
    If Text1.Text = "" Then
    MsgBox " First code password"
    Text1.SetFocus
    Exit Sub
    End If
    Call browser
    cmdserr:
    kpathname = ""
    MsgBox Err.Description

    End Sub[/code]

    but why its gives error that

    can't find DLL entry point SHBROWSERFORFOL DER in shell32

    please tell me
    Last edited by debasisdas; Dec 6 '07, 06:48 AM. Reason: formatted using code tags
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Please find more about SHBROWSERFORFOL DER.

    Comment

    Working...