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. Windows Development
  4. Previewing files within an application

Previewing files within an application

Scheduled Pinned Locked Moved Windows Development
csharpc++wpfwindows-adminalgorithms
3 Posts 3 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.
  • K Offline
    K Offline
    kalberts
    wrote on last edited by
    #1

    The File Explorer can preview any file for which a preview function is set up in the registry (for that file extension). If I want the same functionality in my application: displaying for preview any file for which a viewer is defined in a windows pane in my application, is there an API that lets me utilize the File Explorer preview function? Or will I have to reinvent the wheel by writing my own code for searching the registry and activating the previewer specified there? I would prefer to have it available in C# and WPF compatible, but I guess that is over-optimistic, so I guess it will be C/C++.

    L J 2 Replies Last reply
    0
    • K kalberts

      The File Explorer can preview any file for which a preview function is set up in the registry (for that file extension). If I want the same functionality in my application: displaying for preview any file for which a viewer is defined in a windows pane in my application, is there an API that lets me utilize the File Explorer preview function? Or will I have to reinvent the wheel by writing my own code for searching the registry and activating the previewer specified there? I would prefer to have it available in C# and WPF compatible, but I guess that is over-optimistic, so I guess it will be C/C++.

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

      I have not done this myself, but I have used other functions in The Windows Shell - Win32 apps | Microsoft Docs[^]. Take a look to see if there is anything there that might help.

      1 Reply Last reply
      0
      • K kalberts

        The File Explorer can preview any file for which a preview function is set up in the registry (for that file extension). If I want the same functionality in my application: displaying for preview any file for which a viewer is defined in a windows pane in my application, is there an API that lets me utilize the File Explorer preview function? Or will I have to reinvent the wheel by writing my own code for searching the registry and activating the previewer specified there? I would prefer to have it available in C# and WPF compatible, but I guess that is over-optimistic, so I guess it will be C/C++.

        J Offline
        J Offline
        JudyL_MD
        wrote on last edited by
        #3

        You can do it in C#, and yes, you have to do your own registry searches. I can't remember if it had to call down into the Win32 API to do it or not. Unfortunately, the code I wrote (three years ago) that does this is on a network in a building that is closed right now so I can't take a peek and refresh my memory. It wasn't too hard, as I recall, but you do need to roll your own.

        Be wary of strong drink. It can make you shoot at tax collectors - and miss. Lazarus Long, "Time Enough For Love" by Robert A. Heinlein

        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