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. WINDOWS Directory

WINDOWS Directory

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
7 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello, I have written a function GetFilesInDirectory(CString szpath) , which gets names of all filles in given directory,for example GetFilesInDirectory("c:\\Windows"), now the problem is that different people with different versions of Windows , may have their windows directory named differently (WIN,WIN2000,...) i want to know if i can pass my function such value that will give all files from Windows directory,regardless how the user has called it, for example in REGEDIT , %Windir% is a variable that refers to the Windows installation folder. Regards, m0n0

    2 1 Reply Last reply
    0
    • L Lost User

      Hello, I have written a function GetFilesInDirectory(CString szpath) , which gets names of all filles in given directory,for example GetFilesInDirectory("c:\\Windows"), now the problem is that different people with different versions of Windows , may have their windows directory named differently (WIN,WIN2000,...) i want to know if i can pass my function such value that will give all files from Windows directory,regardless how the user has called it, for example in REGEDIT , %Windir% is a variable that refers to the Windows installation folder. Regards, m0n0

      2 Offline
      2 Offline
      224917
      wrote on last edited by
      #2

      GetWindowsDirectory() GetSystemDirectory()


      suhredayan
      There is no spoon.

      L 1 Reply Last reply
      0
      • 2 224917

        GetWindowsDirectory() GetSystemDirectory()


        suhredayan
        There is no spoon.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        [Message Deleted]

        2 T 2 Replies Last reply
        0
        • L Lost User

          [Message Deleted]

          2 Offline
          2 Offline
          224917
          wrote on last edited by
          #4

          TCHAR szWin[MAX_PATH]; TCHAR szSys[MAX_PATH]; GetWindowsDirectory(szWin,MAX_PATH); GetSystemDirectory(szSys,MAX_PATH);


          suhredayan
          There is no spoon.

          L 1 Reply Last reply
          0
          • 2 224917

            TCHAR szWin[MAX_PATH]; TCHAR szSys[MAX_PATH]; GetWindowsDirectory(szWin,MAX_PATH); GetSystemDirectory(szSys,MAX_PATH);


            suhredayan
            There is no spoon.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Thanks m0n0

            1 Reply Last reply
            0
            • L Lost User

              [Message Deleted]

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              LPCSTR means : LP for Long pointer ('cause pointers are 4-bytes long) C for Constant STR for String so, if you like GetWindowwDirectory() to write into your variable, it musn't be constant.... understand ?


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              A 1 Reply Last reply
              0
              • T toxcct

                LPCSTR means : LP for Long pointer ('cause pointers are 4-bytes long) C for Constant STR for String so, if you like GetWindowwDirectory() to write into your variable, it musn't be constant.... understand ?


                TOXCCT >>> GEII power
                [toxcct][VisualCalc]

                A Offline
                A Offline
                Alex H 1983
                wrote on last edited by
                #7

                wow very nice explanation thank you very helpful

                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