CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Open a folder....

    You know when you press the command button, you can "open" and .exe, but I need to open a folder...like if I press button, I want it to open "c:\windows", so that I can see contains of "c:\windows" folder

    Thank You


  2. #2

    Re: Open a folder....

    I'll give you general outline of how to do this:

    1. In VB6, use filesystem object to get a folder object. From the folder object, you can return a list of files in the folder. (If no VB6, you are stuck with the Dir Function).

    2. Iterate through the files collection (or do until dir(FolderName) = "" if your not using VB6), adding each file name to a listview or list box control.

    If this is not enough, let me know and I'll hammer out the code.


  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Open a folder....

    If you are looking for files use 'File-OPen' dialog of common dialog set.

    If you want directories only selection use ShBrowseForFolder API. Search on this site for this. You can surely find a a few examples and links

    RK

  4. #4
    Join Date
    Sep 1999
    Posts
    11

    Re: Open a folder....

    Shell ("C:\WINDOWS\Explorer.exe c:\windows")

    this coce in click event will open windows dir


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

Featured