Preview Handler Association Editor

I received an email from MSDN Magazine subscriber Oren Novotny thanking me for my preview handler article in the January 2007 issue of MSDN Magazine.  Oren also wondered whether a tool could be written to make it easy to edit preview handler registrations for particular extensions.  For example, what if you wanted to associate the Microsoft Windows TXT Preview Handler with .reg or .h files so that those would be previewable, where they're not by default.  Or what if you had two different preview handlers for XML files and you wanted to be able to easily switch back and forth between them with relative ease.

As an answer to this, I threw together a Preview Handler Association Editor tool.  When the app loads, it looks to the registry for all registered preview handlers.  It then loops through all classes and extensions in HKCR to see if each has a preview handler registered, and if it does, which.  Once that data is loaded (which on my machine takes approximately a second), the interface displays a combobox allowing you to pick any of the registered preview handlers.  The listbox with checkboxes of classes and extensions is then refreshed to show all of the classes/extensions; those associated with the selected preview handler will be checked.  Checking items that aren't checked causes them to be immediately associated with the selected preview handler, and unchecking checked items causes them to be immediately unregistered for the selected preview handler.  You can also check the "Only show classes associated with this handler" check box to filter down the list to make it easier to see all of the extensions/classes currently associated with the selected handler. This tools is provided "as is" with no warranties and confers no rights. It's covered by the Microsoft Permissive License.

PreviewHandlerEditor.zip