Results 1 to 21 of 21

Thread: [RESOLVED] Common Dialog to Open Folders (Not Browse Folder API)

  1. #1

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Resolved [RESOLVED] Common Dialog to Open Folders (Not Browse Folder API)

    I've done searching for this for the last 10 minutes or so and all I can find is stuff about the Browse Folder API. What I am looking for is the standard common dialog Open window, that lets you select folders instead of files. Is this possible or do I have to use the Browse Folder API?
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

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

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Well, you could use the DirListbox and DriveListbox.

    Other than those two controls, used in tandem, the SHBrowseFolder API is it.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    I couldn't find the nice example I had of it but the API you are after is SHBrowseForFolder.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Found it:

    Attached Files Attached Files

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

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Quote Originally Posted by penagate
    I couldn't find the nice example I had of it but the API you are after is SHBrowseForFolder.
    I think he has already found that, but doesn't want to use it.

  6. #6
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Hmm, well, it's the only way to get the Browse for Folder dialog box. It isn't included as part of the CommonDialog control.

  7. #7

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Ok, I guess I will just use that. I just thought I had seen a normal Common Dialog that allows folder selection before. As always, thanks for the help guys.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  8. #8
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    There is a folder TreeView control available from CCRP (common control replacement project). Would that do?

  9. #9

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Thanks baja, but I was looking for a normal Common Dialog that lets you select folders. Since that doesn't seem to be possible, I will just use the API.

    Thanks anyways.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  10. #10
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    No problem, but be sure to check them out. Those guys have some excellent controls. (you can just google them, I dont remember the exact URL right now)

  11. #11

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Will do. Thanks a lot.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

  12. #12
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    537

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Here is some code I posted yesterday or the day before.

    VB Code:
    1. Private Sub Form_Load()
    2. Dim Shell As New Shell, Path As String
    3.  
    4. Set Shell = New Shell32.Shell
    5.  
    6. Path$ = Shell.BrowseForFolder(Me.hWnd, "Title Here", 0, "C:\")
    7.  
    8. MsgBox Path$
    9.  
    10. Set Shell = Nothing
    11. End Sub

    This code will bring up a little "Browse For Folder" dialog.

    Hope this helps,
    Sir Loin

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

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    And how does he make it browse for folders?

  14. #14

  15. #15
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Quote Originally Posted by RhinoBull
    If you want to create your own "dialog" then there is a FolderTreeview
    control created by Brad Martinez few years ago - really nicely done. It could be found HERE .
    Isn't that what I suggested?

  16. #16

  17. #17
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Of course it is. Now I have to send wossy to kill you. Then maybe you will think twice before posting.

  18. #18

  19. #19
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Wossname. You didn't know? That will only make him angry.

  20. #20

  21. #21

    Thread Starter
    No place like 127.0.0.1 eyeRmonkey's Avatar
    Join Date
    Jul 2005
    Location
    Blissful Oblivion
    Posts
    2,306

    Re: Common Dialog to Open Folders (Not Browse Folder API)

    Ok, guys. I think I will just use the API. I might take a look at inventrex's method though, because I'm not sure what it does (I havn't plugged it into a form yet).

    Thanks all.
    Visual Studio 2005 Professional Edition (.NET Framework 2.0)
    ~ VB .NET Links: Visual Basic 6 to .NET Function Equivalents (Thread) | Refactor! (White Paper) | Easy Control for Wizard Forms | Making A Proper UI For WinForms | Graphics & GDI+ Tutorial | Websites For Free Icons
    ~ QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. -Rich Cook

    ~ eyeRmonkey.com

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