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. How to tell whether explorer is hiding extensions for known file types ?.

How to tell whether explorer is hiding extensions for known file types ?.

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 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.
  • A Offline
    A Offline
    Atom
    wrote on last edited by
    #1

    Hi, Can anyone supply sample code that can get/set the state of the "Hide extensions for known file types" check box, which is in control panel "Folder Options". Many thanks.

    D 1 Reply Last reply
    0
    • A Atom

      Hi, Can anyone supply sample code that can get/set the state of the "Hide extensions for known file types" check box, which is in control panel "Folder Options". Many thanks.

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

      Check out HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced in the registry.


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

      "We will be known forever by the tracks we leave." - Native American Proverb

      A 1 Reply Last reply
      0
      • D David Crow

        Check out HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced in the registry.


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

        "We will be known forever by the tracks we leave." - Native American Proverb

        A Offline
        A Offline
        Atom
        wrote on last edited by
        #3

        Thanks David your advice was very helpful. Although it hasn't entirely solved my problem, which is in code similar to this. CFileDialog D; if( D.DoModal() == IDOK ) { CString strFPN = D.GetFileName(); CString strExt = D.GetFileExt(); CString strFPNandExt = strFPN + strExt; // Do stuff here with strFPNandExt... } My problem is that when explorer is hiding file extensions, CFileDialog::GetFileExt() returns a null string. So what I really need to know is whether there is a way to get the file extension of a file that is selected in CFileDialog, (or maybe anywhere in the shell) when file extensions are hidden. I don't really want to have a registry value changed and then restored when CFileDialog::DoModal() has finished its business.

        D 1 Reply Last reply
        0
        • A Atom

          Thanks David your advice was very helpful. Although it hasn't entirely solved my problem, which is in code similar to this. CFileDialog D; if( D.DoModal() == IDOK ) { CString strFPN = D.GetFileName(); CString strExt = D.GetFileExt(); CString strFPNandExt = strFPN + strExt; // Do stuff here with strFPNandExt... } My problem is that when explorer is hiding file extensions, CFileDialog::GetFileExt() returns a null string. So what I really need to know is whether there is a way to get the file extension of a file that is selected in CFileDialog, (or maybe anywhere in the shell) when file extensions are hidden. I don't really want to have a registry value changed and then restored when CFileDialog::DoModal() has finished its business.

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

          Atom wrote:

          So what I really need to know is whether there is a way to get the file extension of a file that is selected in CFileDialog, (or maybe anywhere in the shell) when file extensions are hidden.

          See here.


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

          "We will be known forever by the tracks we leave." - Native American Proverb

          A 1 Reply Last reply
          0
          • D David Crow

            Atom wrote:

            So what I really need to know is whether there is a way to get the file extension of a file that is selected in CFileDialog, (or maybe anywhere in the shell) when file extensions are hidden.

            See here.


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

            "We will be known forever by the tracks we leave." - Native American Proverb

            A Offline
            A Offline
            Atom
            wrote on last edited by
            #5

            Superb, just what I need. Many thanks.:)

            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