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. Path to user's desktop folder

Path to user's desktop folder

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 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.
  • M Offline
    M Offline
    moredip
    wrote on last edited by
    #1

    Hi All, Ok, this should be easy to figure out, but I can't seem to google a good answer. I need a way to programmatically discover the path to the current user's desktop. Something similar to GetWindowsDirectory() or GetSystemDirectory(), I guess. The only think I could find was VBScript stuff like WshShell.SpecialFolders(...) or using the Windows Shell COM stuff. There must be a simpler way to do this in C++, no? TIA, Pete

    D 1 Reply Last reply
    0
    • M moredip

      Hi All, Ok, this should be easy to figure out, but I can't seem to google a good answer. I need a way to programmatically discover the path to the current user's desktop. Something similar to GetWindowsDirectory() or GetSystemDirectory(), I guess. The only think I could find was VBScript stuff like WshShell.SpecialFolders(...) or using the Windows Shell COM stuff. There must be a simpler way to do this in C++, no? TIA, Pete

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

      How about SHGetFolderPath(..., CSIDL_DESKTOPDIRECTORY, ...)?


      "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

      M 1 Reply Last reply
      0
      • D David Crow

        How about SHGetFolderPath(..., CSIDL_DESKTOPDIRECTORY, ...)?


        "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

        M Offline
        M Offline
        moredip
        wrote on last edited by
        #3

        That'd do it! Thanks David :)

        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