Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Opening folders

Opening folders

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dave_long
    wrote on last edited by
    #1

    Hi i would like to know how to open a folder, from hitting a button on a dialog wizard/app. What i want to achieve is this: This wizard i want to create will create a file which is needed by a 3rd party program. What i want to do is once the button is pressed which creates the new folder, i want to press another button which will open up the folder where that new file was created. I dont ned to know how to create buttons etc. Its just how do i open a normal folder from clicking on a button? Any ideas? kind regards Dave Long

    V 1 Reply Last reply
    0
    • D dave_long

      Hi i would like to know how to open a folder, from hitting a button on a dialog wizard/app. What i want to achieve is this: This wizard i want to create will create a file which is needed by a 3rd party program. What i want to do is once the button is pressed which creates the new folder, i want to press another button which will open up the folder where that new file was created. I dont ned to know how to create buttons etc. Its just how do i open a normal folder from clicking on a button? Any ideas? kind regards Dave Long

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      What do you mean "open" a folder? If the program creates a file in a specific folder and that folder does not exist, then the program should loop through the full folder path and create each folder accordingly beginning at the parent folder, i.e. "C:\" Kuphryn

      D 1 Reply Last reply
      0
      • V valikac

        What do you mean "open" a folder? If the program creates a file in a specific folder and that folder does not exist, then the program should loop through the full folder path and create each folder accordingly beginning at the parent folder, i.e. "C:\" Kuphryn

        D Offline
        D Offline
        dave_long
        wrote on last edited by
        #3

        The folder already exists and the file that gets created is placed in that existing folder. All i want is to be able to click a button on the wizard to display that folder without having to manually open it by double clicking icons until i get to the folder to display the file. Dave Long

        J H 2 Replies Last reply
        0
        • D dave_long

          The folder already exists and the file that gets created is placed in that existing folder. All i want is to be able to click a button on the wizard to display that folder without having to manually open it by double clicking icons until i get to the folder to display the file. Dave Long

          J Offline
          J Offline
          J Dunlap
          wrote on last edited by
          #4

          ShellExecute() with the command line being the folder path. :)

          "Do unto others as you would have them do unto you." - Jesus
          "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

          1 Reply Last reply
          0
          • D dave_long

            The folder already exists and the file that gets created is placed in that existing folder. All i want is to be able to click a button on the wizard to display that folder without having to manually open it by double clicking icons until i get to the folder to display the file. Dave Long

            H Offline
            H Offline
            Hari Krishnan Noida
            wrote on last edited by
            #5

            Hi, Try the following code, it will open the specified folder in explorer. void UserDialog::OnButtonClicked() { ShellExecute(GetSafeHwnd (), "open", "C:\\dave\\folder", NULL, NULL, SW_SHOWNORMAL); } regards ~Hari~

            D 1 Reply Last reply
            0
            • H Hari Krishnan Noida

              Hi, Try the following code, it will open the specified folder in explorer. void UserDialog::OnButtonClicked() { ShellExecute(GetSafeHwnd (), "open", "C:\\dave\\folder", NULL, NULL, SW_SHOWNORMAL); } regards ~Hari~

              D Offline
              D Offline
              dave_long
              wrote on last edited by
              #6

              Hi Hari Great thanks that worked a treat. kind regards Dave Long Hi, Try the following code, it will open the specified folder in explorer. void UserDialog::OnButtonclicked() { ShellExecute(GetSafeHwnd (), "open", "C:\\dave\\folder", NULL, NULL, SW_SHOWNORMAL); } regards ~Hari~

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups