What I want to do is force Windows to use my program as a base for creating thumbnail from some kind of files that are not images.
In Windows you can see thumbnails from images, word documents, pdf´s etc – this is what I want with other file types. I can create bitmaps from these files (which later I want to use as a thumbnails) and store them somewhere.
My question is how to connect extension with request of creating/checking if they exists thumbnail with my program and returning image/path to image. Any help and example will be very helpful.
You need to create a COM DLL library, with a class that implements
IExtractImage.You then register your shell extension with the file extension you support under:
Where
.extis the extension of file you are creating a viewer for (e.g..psd)SID_IExtractImageis the constant{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}MyExtractImageShellExtensionCLSIDis the class id (clsid) of your shell extension that implementsIExtractImageSo, if i were registering a Photoshop
psdextension handler, and my COM object’s clsid is{CCB7DB3B-D073-4606-B246-2A5174D274C8}:Then it’s just a matter of creating a COM object that implements:
IPersistIPersistFileIPersistStream(optional)IExtractImageAnd Explorer will use your extension to create a thumbnail of a photoshop image.
Note: If you’re running 64-bit Windows you will need a 64-bit compiler, to create a 64-bit COM object DLL, that 64-bit Windows Explorer can load.