Results 1 to 30 of 30

Thread: Browse Folder, Add Folder Button

  1. #1

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Browse Folder, Add Folder Button

    Hi people, i need the add folder button on the bottom of the browse folder dialog box. The button goes on the bottom next to ok and cancel.
    Attached Images Attached Images  

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Browse Folder, Add Folder Button

    I would suggest it might be easier to make your own control using a form and the drive listbox.

  3. #3

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Browse Folder, Add Folder Button

    Do "i suggest" mean that it is impossible to do?, i would rather use the browse folder dialog box if possible

    cheers
    ILMV

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Browse Folder, Add Folder Button

    Quote Originally Posted by I_Love_My_Vans
    Do "i suggest" mean that it is impossible to do?, i would rather use the browse folder dialog box if possible

    cheers
    ILMV
    It is probably possible with a lot of subclassing code and such. I don't know for sure. But it would be a lot simpler to create your own.

    However, if you want to use browse folder dialog box then I'll see what I can find for you.

  5. #5

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Browse Folder, Add Folder Button

    Thank you mate, i have search for it but with little success, and have only jsut had experience of subclassing, but im will to give it a shot.

    Thkanks

    ILMV

  6. #6
    Hyperactive Member vbcode1980's Avatar
    Join Date
    Nov 2005
    Location
    Anywhere the wind blows
    Posts
    365

    Re: Browse Folder, Add Folder Button

    Perhaps you can use this control from VBAccelerator:
    http://www.vbaccelerator.com/home/VB...er/article.asp

    And perhaps this thread has some answers.
    I code C#....

  7. #7
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Browse Folder, Add Folder Button

    Try This:
    VB Code:
    1. Private Const BIF_NEWDIALOGSTYLE = &H40
    2.  
    3. Private Sub Command1_Click()
    4.     Dim sh As New Shell32.Shell
    5.     Dim str1 As Shell32.Folder2
    6.     Set str1 = sh.BrowseForFolder(Me.hwnd, "Select a Folder", BIF_NEWDIALOGSTYLE, ssfDRIVES)
    7.     If Not str1 Is Nothing Then MsgBox str1.Self.Path
    8. End Sub


    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  8. #8

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Browse Folder, Add Folder Button

    pradeep, didnt work.

    I looked at thevbAccelerator version and works like a charm, so will contiue with that one for now.

    Cheers people

  9. #9
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Browse Folder, Add Folder Button

    Quote Originally Posted by I_Love_My_Vans
    pradeep, didnt work.

    I looked at thevbAccelerator version and works like a charm, so will contiue with that one for now.

    Cheers people
    It will work with Win2000 and above havig IE6 and above only.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  10. #10

    Thread Starter
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Browse Folder, Add Folder Button

    Im on the college computers and loads of things are restricted so that may be the problem.

    ILMV.

    I will try it at home any way.

  11. #11
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Browse Folder, Add Folder Button

    What method are you using to Browse for folders?
    Pradeep's suggestion of adding the BIF_NEWDIALOGSTYLE flag works for me. Here is a full implementation
    VB Code:
    1. Option Explicit
    2. Private Declare Function SHBrowseForFolder _
    3.  Lib "shell32" ( _
    4.  lpbi As BROWSEINFO) As Long
    5.  
    6. Private Declare Function SHGetPathFromIDList _
    7.  Lib "shell32" ( _
    8.  ByVal pidList As Long, _
    9.  ByVal lpBuffer As String) As Long
    10.  
    11. Private Type BROWSEINFO
    12.    hWndOwner As Long
    13.    pIDLRoot As Long
    14.    pszDisplayName As String
    15.    lpszTitle As String
    16.    ulFlags As Long
    17.    lpfnCallback As Long
    18.    lParam As Long
    19.    iImage As Long
    20. End Type
    21.  
    22. Private Const BIF_RETURNONLYFSDIRS = 1
    23. Private Const BIF_DONTGOBELOWDOMAIN = 2
    24. Private Const BIF_NEWDIALOGSTYLE = &H40
    25. Private Const MAX_PATH = 260
    26.  
    27. Public Function BrowseForFolder(OwnerForm As Form) As String
    28.     Dim lpIDList As Long
    29.     Dim sBuffer As String
    30.     Dim tBrowseInfo As BROWSEINFO
    31.    
    32.     With tBrowseInfo
    33.         .pszDisplayName = Space$(MAX_PATH)
    34.         .lpszTitle = "Select a folder"
    35.         .hWndOwner = OwnerForm.hWnd
    36.         .ulFlags = BIF_DONTGOBELOWDOMAIN + BIF_RETURNONLYFSDIRS + BIF_NEWDIALOGSTYLE
    37.     End With
    38.         lpIDList = SHBrowseForFolder(tBrowseInfo)
    39.     If (lpIDList) Then
    40.         sBuffer = Space(MAX_PATH)
    41.         SHGetPathFromIDList lpIDList, sBuffer
    42.         BrowseForFolder = Left$(sBuffer, InStr(sBuffer, vbNullChar) - 1)
    43.     End If
    44. End Function
    45.  
    46. Private Sub Command1_Click()
    47.     MsgBox BrowseForFolder(Me)
    48. End Sub
    If you'd rather use the shell object I can show you how to do that too.

  12. #12
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Browse Folder, Add Folder Button

    I am please to say I was wrong. There isn't that much code involved after all.

    Very nice moeur!

  13. #13
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    good work moeur. but right now i am not able to give you rep. So a :thumbs: up for now .

    i have a question. does ur code will also display the Add Folder button. because it is not showing on my PC. nor does the code provided by Pradeep because i m not using 2000 or Xp nor i have ie6.
    Show Appreciation. Rate Posts.

  14. #14
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Browse Folder, Add Folder Button

    Yes, the Add Folder Button does display.
    Support for the BIF_NEWDIALOGSTYLE flag requires shell32.dll version 5.0 or later; whatever that means.

  15. #15
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    so how can i check the dll version?? if its below version 5 then installing SP can update it??
    Show Appreciation. Rate Posts.

  16. #16
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Browse Folder, Add Folder Button

    I don't know... Perhaps search msdn?

  17. #17
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    Re: Browse Folder, Add Folder Button

    Use the Dependency Walker that come with VS to find all about the dll including its version
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  18. #18
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    thnx Wiz, it seems that it is below ver 5. so does installing SP update it automatically?

    also, how can i add shell32.dll as a reference. i am not able to do it by browsing and dont seem to get the reference name.
    Show Appreciation. Rate Posts.

  19. #19
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Browse Folder, Add Folder Button

    Quote Originally Posted by Harsh Gupta
    thnx Wiz, it seems that it is below ver 5. so does installing SP update it automatically?

    also, how can i add shell32.dll as a reference. i am not able to do it by browsing and dont seem to get the reference name.
    To add the reference to shell32.dll, add a reference to "Microsoft Shell Controls and Automation" to your project.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  20. #20
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    Quote Originally Posted by Pradeep1210
    To add the reference to shell32.dll, add a reference to "Microsoft Shell Controls and Automation" to your project.

    Pradeep
    yeah i did that, but it is using ShDoc401.dll file and not the Shell32.dll.
    Show Appreciation. Rate Posts.

  21. #21
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Browse Folder, Add Folder Button

    The new style of BFF is dependant upon version 5.0 available depending on your OS or IE version.

    Versions:
    http://msdn.microsoft.com/library/de...e/versions.asp

    BIF_NEWDIALOGSTYLE and BIF_USENEWUI
    http://msdn.microsoft.com/library/de...browseinfo.asp
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  22. #22
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    Quote Originally Posted by RobDog888
    The new style of BFF is dependant upon version 5.0 available depending on your OS or IE version.

    Versions:
    http://msdn.microsoft.com/library/de...e/versions.asp

    BIF_NEWDIALOGSTYLE and BIF_USENEWUI
    http://msdn.microsoft.com/library/de...browseinfo.asp
    sorry Rob, but couldn't get your point.
    Show Appreciation. Rate Posts.

  23. #23
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Browse Folder, Add Folder Button

    The two BIF flags - BIF_NEWDIALOGSTYLE and BIF_USENEWUI are only available if you have 5.0 or above. If you dont have 5.0 then the "New Folder" button is not supported at all.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  24. #24
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    Quote Originally Posted by RobDog888
    The two BIF flags - BIF_NEWDIALOGSTYLE and BIF_USENEWUI are only available if you have 5.0 or above. If you dont have 5.0 then the "New Folder" button is not supported at all.
    which one, shell32.dll or ShDoc401.dll. please see post 19 and 20. while Pradeep says adding reference to Microsoft Shell Controls and Automation will add Shell32.dll but it is referencing to ShDoc401.dll on my PC.

    though the version of Shell32 is below but shDoc is of ver 5.
    Show Appreciation. Rate Posts.

  25. #25
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Browse Folder, Add Folder Button

    ShDoc401.dll, I believe, is the dll for IE and not Microsoft Shell Controls and Automation. What are you running? OS + IE versions?

    ShDoc401.dll is not in the chart on the MS page link I posted.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  26. #26
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    OS - Win 98 SE
    IE - version 5.00.2614.3500
    Show Appreciation. Rate Posts.

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Browse Folder, Add Folder Button

    Its explained in Note 3
    Quote Originally Posted by MS
    Note 3: Version 5.80 of Comctl32.dll and version 5.0 of Shlwapi.dll are distributed with Internet Explorer 5. They will be found on all systems on which Internet Explorer 5 is installed, except Windows 2000. Internet Explorer 5 does not update the Shell, so version 5.0 of Shell32.dll will not be found on Windows NT, Windows 95, or Windows 98 systems. Version 5.0 of Shell32.dll will be distributed with Windows 2000 and Windows Me, along with version 5.0 of Shlwapi.dll, and version 5.81 of Comctl32.dll.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  28. #28
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    Re: Browse Folder, Add Folder Button

    so can this be fixed by installing any SP on my PC?? if not then how can i show Add folder buuton on the Browse folder Dialog box?
    Show Appreciation. Rate Posts.

  29. #29
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Browse Folder, Add Folder Button

    I would go with the suggestion in Post #2. Just create your own control.

  30. #30
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Browse Folder, Add Folder Button

    You can upgrade to IE 6 SP1 and VS SP6 as it states that its available in IE 5 but not on the bundled instance that is distributed with Win 2000 or ME. You need to get Version 5.80 of Comctl32.dll and version 5.0 of Shlwapi.dll. So if they are included with installing IE 6 SP1 and VS SP6 then that should do it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width