Discussion, code samples and video demos of new technologies; including Web 2.0 startups, Google AppEngine, Ruby on Rails, PHP, Visual Studio Team System, Team Foundation Server and .NET.

Wednesday, January 3, 2007

Quick post about Windows Vista - Thumbnail Provider Sample

One of the things that I fondly remember about working on the Visual C++ team years ago are some of the folks I worked with at the time.  I was relatively junior, and the people on the MFC and ATL libraries teams were quite senior.  What always struck me was how much those guys knew about the inner workings of Windows.

With a new version of Windows to play with - Vista - I've been spending some time plugging away at the plumbing underneath.  Namely, the Windows Shell.  Funny to say that it is 'plumbing' given that it is the most visible part of Windows.  The one thing I've learned about the Windows Shell is that you don't really know Windows until you start programming against the Shell. http://shellrevealed.com is a great site for learning more about the Shell.

I'm hoping to eventually take some of what I learn about the Shell to eventually write a Team Foundation Server Shell extension or two - namely, I'd like to be able to right-click and check out/in.  But also, I would like a preview handler for source files and what not.

One of my first steps towards this is building a thumbnail provider.  A thumbnail provider enables you to tell the Shell to render a specific thumbnail for a file.  That in of itself is nothing new - you could always associate an icon with a file extension.  But Vista takes this to another level.  By inheriting from a IThumbnail provider interface, you can decide what thumbnail Vista should render for each instance of a file type.  It's just another way to deliver information.  For example, in terms of Team Foundation Server, I could imagine writing a thumbnail provider that tells you if a file is checked out or not.

I had been really struggling with getting the Thumbnail Provider sample in the Platform SDK working. 

I'm not sure what I'm doing wrong, but in looking at a few forums, I noticed some other people having the same problem.  I re-did the sample using ATL attributes and for some reason that seemed to have fixed my problem. 

You can get my sample here; hope it helps, suggestions are welcome!

Eric.

Labels: