How to add it with Visual Studio C# Express 2005:
- Start a new project, Windows Application.
- In the Solution Explorer, right click on References and choose Add Reference.
- Go to the COM tab and scroll down to webvw 1.0 Type Library and press OK.
- In the Toolbox, right click anywhere and choose Choose Items.
- Go to the COM Components tab and scroll down to ThumbCtl Class. There are two, one has Language set to Unknown and the other to Independent. Unknown was the only one that worked for me, so tick that box and press OK.
- In the Toolbox, under Menus & Toolbars select ThumbCtl Class and draw out a rectangle on your form. This is where you'll see your thumbnail.
Done! To use it all you need to do is call the displayFile() function and passing it the filepath to your image!
If there's a registered thumbnail extractor (COM object: IExtractImage) then windows will call that and present the image on the area you drew out on your form. Here's a snip from my latest sample:
There's one thing though, I couldn't find a way to control how the thumbnail is generated so it'll stretch and deform your image however it feels like. =P
There is another function, haveThumbnail(), which oddly enough returns false whether or not you've called displayFile()... And the three properties (freeSpace, totalSpace, usedSpace) all return an empty string both before and after calling displayFile(). MSDN isn't helping since I only see ThumbCtl mentioned in other articles, but never explained in detail.
You can also use it in VB and C++. VB should be easy For C++, this MSDN article says: "To exploit this control in your MFC application, just add it to the dialog template. Microsoft Visual C++(R) will generate a wrapper class CThumbCtl. Next, define a member variable for it in your dialog class:"
If someone wants to write a sample and send it over I'll post it. =)
This sample and others are available on the ThumbView Project site, under Developers Corner. This particular sample is called "Thumbnail Viewer .NET 2.0 ActiveX".
Thanks to gwihlidal for the help.