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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Directory Control

Directory Control

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsontutorial
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.
  • J Offline
    J Offline
    jonesap5
    wrote on last edited by
    #1

    I need to know how to control a directory structure from the "Open" dialog window from an application. I need to be able to restict the user from going to directories that have been determined they should not enter and restrict them to a certain directory. Anyone have any idea how to do this not in MFC, win32 api format. Thanks,

    W D G 3 Replies Last reply
    0
    • J jonesap5

      I need to know how to control a directory structure from the "Open" dialog window from an application. I need to be able to restict the user from going to directories that have been determined they should not enter and restrict them to a certain directory. Anyone have any idea how to do this not in MFC, win32 api format. Thanks,

      W Offline
      W Offline
      Waldermort
      wrote on last edited by
      #2

      You can restrict them to a single directory using the OFN_NOCHANGEDIR flag. If you need something a little more complicated then create your own OpenFile dialog.

      D 1 Reply Last reply
      0
      • W Waldermort

        You can restrict them to a single directory using the OFN_NOCHANGEDIR flag. If you need something a little more complicated then create your own OpenFile dialog.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        waldermort wrote:

        You can restrict them to a single directory using the OFN_NOCHANGEDIR flag.

        Wrong. That flag restores the current directory to its original value if the user changed the directory while searching for files.


        "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

        "There is no death, only a change of worlds." - Native American Proverb

        W 1 Reply Last reply
        0
        • J jonesap5

          I need to know how to control a directory structure from the "Open" dialog window from an application. I need to be able to restict the user from going to directories that have been determined they should not enter and restrict them to a certain directory. Anyone have any idea how to do this not in MFC, win32 api format. Thanks,

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          See here.


          "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

          "There is no death, only a change of worlds." - Native American Proverb

          1 Reply Last reply
          0
          • D David Crow

            waldermort wrote:

            You can restrict them to a single directory using the OFN_NOCHANGEDIR flag.

            Wrong. That flag restores the current directory to its original value if the user changed the directory while searching for files.


            "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

            "There is no death, only a change of worlds." - Native American Proverb

            W Offline
            W Offline
            Waldermort
            wrote on last edited by
            #5

            Thanks for pointing that out, learn something new everyday :->

            1 Reply Last reply
            0
            • J jonesap5

              I need to know how to control a directory structure from the "Open" dialog window from an application. I need to be able to restict the user from going to directories that have been determined they should not enter and restrict them to a certain directory. Anyone have any idea how to do this not in MFC, win32 api format. Thanks,

              G Offline
              G Offline
              gamitech
              wrote on last edited by
              #6

              the hard way would be hooking ZwQueryDirectoryFile and restricting your diretories. :P I'm sure there is an easier way gabby

              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