Question

I have a file format I need to be able to show in explorer thumbnails. Since the target system is windows XP, the Vista PreviewHandler API will not be suitable. Ill be using c++.

How would I do it?

Was it helpful?

Solution

You'll need to register a shell extension for your file type. The extension contains code that extracts/generates the thumbnail by implementing the IExtractImage interface.

See: IExtractImage Interface on MSDN

OTHER TIPS

https://github.com/reliak/moonpdf/tree/master/ext/sumatra/src/previewer is perfect example.

To build both x86 and x64 versions of DLL I use VS 2010 with SP1 along with Win7 x64 SDK (for <thumbcache.h>) installed on Windows 7 x64. Builded DLLs works fine on Win7 and Win10 of either bitness.

Also don't forget /MD linker flag to avoid necessity to install Microsoft Visual C++ 2010 Redistributable Package (x86) on WinXP.

Next lines may be added to "targetver.h" to avoid import and using of new functions from newer versions of Windows system DLLs (say, there is no RegDeleteTreeW in WinXP's advapi.dll):

#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <winsdkver.h>
#include <SDKDDKVer.h>

Additionally it has implementation of previewer for some file formats, but related interfaces can be completely omitted in your implementation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top