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. getting filetype description from _extension_

getting filetype description from _extension_

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

    Hi I wan't to be able to get a filetypes icon, preferably the position in the system image list, and the description string. Is there any API for this? OBS! I know that I can use SHGetFileInfo, but then I must supply filename. I need it on extension basis. I prefer to be anonymous.

    R 1 Reply Last reply
    0
    • L Lost User

      Hi I wan't to be able to get a filetypes icon, preferably the position in the system image list, and the description string. Is there any API for this? OBS! I know that I can use SHGetFileInfo, but then I must supply filename. I need it on extension basis. I prefer to be anonymous.

      R Offline
      R Offline
      Rui Lopes
      wrote on last edited by
      #2

      I think you can still use the SHGetFileInfo, but you have to specify the GFI_USEFILEATTRIBUTES flag in the uFlags argument, this way the function does not access the specified file, so you can pass a bogus file name with the extension you want. If this does not work, you can still look for all the informations you want in the registry...... Good luck! Rui Lopes

      L 1 Reply Last reply
      0
      • R Rui Lopes

        I think you can still use the SHGetFileInfo, but you have to specify the GFI_USEFILEATTRIBUTES flag in the uFlags argument, this way the function does not access the specified file, so you can pass a bogus file name with the extension you want. If this does not work, you can still look for all the informations you want in the registry...... Good luck! Rui Lopes

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

        Thanks a lot! It worked perfectly except for the icons for directories!

        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