+1  A: 

There's a series of articles on CodeProject that details writing Shell Extensions and is very good:

http://www.codeproject.com/KB/shell/shellextguide1.aspx

Peter Ritchie
+2  A: 

Such a handler must be registered in HKCR\Directory\Background, instead of usual locations like HKCR\Directory, HKCR\Folder, etc.

Check out Creating Shell Extension Handlers in MSDN.

efotinis