Previewing files within an application
-
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++.
-
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++.
-
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++.
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