Click here to Skip to main content
Click here to Skip to main content

The Complete Idiot's Guide to Writing Shell Extensions - Index

By , 1 Jun 2002
 

Since the Idiot's Guide series has become quite large, here is an index of all the articles that gives a quick blurb about each one, so you can quickly find the articles that interest you.

Some other dedicated folks are writing translations of the Guide. Here are the published translations:


Part I - A step-by-step tutorial on writing shell extensions

 [Part 1 screen shot - 9K]

Part I is a simple overview of shell extensions, and discusses how to debug them. The sample extension illustrates adding items to the context menu for text files.

Part II - A tutorial on writing a shell extension that operates on multiple files at once

 [Part 2 screen shot - 5K]

Part II demonstrates how to write a context menu extension that operates on all of the selected files at once. The sample project is a utility that adds registration and unregistration commands to the context menus for DLLs.

Part III - A tutorial on writing a shell extension that shows pop-up info for files

 [Part 3 screen shot - 6K]

Part III demonstrates the QueryInfo extension that customizes the infotip for text files. It also explains how to use MFC in a shell extension.

Part IV - A tutorial on writing a shell extension that provides custom drag and drop functionality

 [Part 4 screen shot - 12K]

Part IV shows how to add items to the menu displayed when the user drags and drops with the right mouse button in Explorer. The sample project is a utility that makes hard links for files. (Note: the extension is functional only on Windows 2000, but you can still compile and run the extension on previous versions of Windows. See the article for instructions.)

Part V - A tutorial on writing a shell extension that adds pages to the properties dialog of files

 [Part 5 screen shot - 23K]

Part V demonstrates how to add new pages to Explorer's Properties dialog. The sample project adds a page on which you can edit the created, modified, and last accessed times of files.

Part VI - A tutorial on writing a shell extension that can be used on the Send To menu

 [Part 6 screen shot - 9K]

Part VI discusses a drop handler extension that gets added to the SendTo menu. The sample project is a clone of the Send To Any Folder power toy.

Part VII - A tutorial on using owner-drawn menus in a context menu shell extensions, and on making a context menu extension that responds to a right-click in a directory background

 [Part 7 screen shot - 6K]

Part VII tackles two topics suggested by readers: owner-drawn menu items and the context menu for the background of directory windows. The sample project contains two extensions: a bitmap viewer (pictured above) that puts a thumbnail of BMP files in the context menu, and a simple extension that adds items to the context menu of directory backgrounds.

Part VIII - A tutorial on adding columns to Explorer's details view via a column handler shell extension

 [Part 8 screen shot - 6K]

Part VIII demonstrates how to add columns to the details view of Explorer on Windows 2000. The sample project adds a few columns that show ID3v1 tag data in MP3 files.. (This extension works only on Windows 2000.)

Part IX - A tutorial on writing an extension to customize the icons displayed for a file type.

 [Part 9 screen shot - 24K]

Part IX shows how to customize file icons on a file-by-file basis. The demo project is an extension that shows 4 different icons for text files, depending on the size of the file.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Michael Dunn
Software Developer (Senior) VMware
United States United States
Michael lives in sunny Mountain View, California. He started programming with an Apple //e in 4th grade, graduated from UCLA with a math degree in 1994, and immediately landed a job as a QA engineer at Symantec, working on the Norton AntiVirus team. He pretty much taught himself Windows and MFC programming, and in 1999 he designed and coded a new interface for Norton AntiVirus 2000.
Mike has been a a developer at Napster and at his own lil' startup, Zabersoft, a development company he co-founded with offices in Los Angeles and Odense, Denmark. Mike is now a senior engineer at VMware.

He also enjoys his hobbies of playing pinball, bike riding, photography, and Domion on Friday nights (current favorite combo: Village + double Pirate Ship). He would get his own snooker table too if they weren't so darn big! He is also sad that he's forgotten the languages he's studied: French, Mandarin Chinese, and Japanese.
 
Mike was a VC MVP from 2005 to 2009.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionIs it possible that the explorer load my extension dll after windows startupmemberdkuser6-May-13 0:34 
GeneralMy vote of 5memberPraveen P N14-Apr-13 3:46 
QuestionShell Extension instantiated twice when Explorer Tree is right clicked.memberMember 42776548-Jun-12 23:12 
Thank you for the great tutorials. They've been very helpful.
 
I have a shell extension that is registered to "AllFileObjects" and "Directory\Background" registry keys. The problem occurs when a folder in the Explorer Tree View is right clicked. The shell instantiates my shell extension twice, once with the folder name supplied in the pDataObj argument to Initialize, and once with the folder name supplied in the pidlFolder argument. This results in my menu items being added twice. Not good.
 
By implementing the registrations one at a time I have determined that (as I expected) the call passing the folder in the pDataObj is coming from the "AllFileObjects" registration and the call passing the folder in the pidlFolder argument is coming from the "Directory\Background" registration.
 
I need both registrations to be able to provide proper functionality from the Explorer file view pane but don't want two sets of menu items if the user selects in the tree view.
 
I've been trying to figure a way to identify when the call to Initialize and/or QueryContextMenu is from one of the Tree View entries so I can ensure only one set of menu items is added to the context menu. I've been evaluating the flag values passed through the fifth argument to QueryContextMenu.
 
I've noted that the 0x00020000 bit is set in the flag when the call is coming from the Explorer file view (even the background) and from any Desktop interaction. This bit is NOT set when the call is coming from the Exporer tree view. However I can't find any documentation about this bit (it is listed as one of the CMF_RESERVED bits in Microsoft documentation so I am reluctant to rely on it.
 
When a Folder or File is clicked in the Tree view or Desktop the 0x00000080 bit is set. This bit is not set for background clickes in either of these items and it is never set for clicks to the Tree view.
 
The other item I've been looking at is the registry key passed into IShellExtInit::Initialize as the third argument. I haven't been able to identify what key is actually being passed in. The documentation I've found is pretty vague saying that it is "the registry key for the file object or folder type". I have not been able to figure out what I might be able to do with this to differentiate the call.
 
I am actually hoping that there is something that I'm overlooking...
 
I am developing with VS2010 targeting Windows 7 64 bit.
 
If you or anyone can shed some light on my predicament it would be greatly appreciated.
 
Thanks in advance!
QuestionPart 1 is 404memberCuchullain1-Dec-11 3:59 
QuestionHow I can insert a menu item to the context menu(pop-up menu) when no file(s)/dir(s) selected for the explorer?memberzhoufanglong12-Aug-10 20:30 
GeneralAdd button to Windows Explorer's existing toolbarmemberJahangirRazaShah18-Jun-10 2:34 
GeneralRe: Add button to Windows Explorer's existing toolbarmemberzhoufanglong12-Aug-10 20:40 
QuestionCan we Implement "Show in Groups"membergurjant singh7-Oct-09 20:02 
QuestionNew Image File Type Showing Thumbnails?membersilentbutdeadly6-Apr-09 18:40 
QuestionCan we split the browsermemberJaved Akhtar Ansari21-Sep-08 19:06 
AnswerRe: Can we split the browsermemberTimo Kunze18-Oct-08 6:52 
QuestionRe: Can we split the browsermemberJaved Akhtar Ansari20-Oct-08 20:19 
GeneralShell exec to run sort.exememberMember 45577020-Jan-08 22:05 
GeneralIssue with InsertMenumemberJeffrey Walton12-Jul-07 16:30 
Questionwindows file dialog?membermadfiddlerchris6-Jul-07 2:18 
AnswerRe: windows file dialog?mvpMichael Dunn6-Jul-07 6:37 
GeneralShell extension for "system Task" of "My computer" itemsmemberpada4412-Apr-07 13:45 
QuestionVista Shell - How to set "Tags:" and "Rating:" programatically for ImagesmemberQuint King22-Nov-06 10:27 
AnswerRe: Vista Shell - How to set "Tags:" and "Rating:" programatically for ImagessitebuilderMichael Dunn26-Dec-06 16:11 
QuestionAnd what's about folders?:)memberKir0s20-Nov-06 4:01 
GeneralAsk about Shell: change icon & handling eventsmembernamphvn15-Sep-06 13:33 
QuestionF2 HandlermemberMor FTP16-Aug-06 15:55 
GeneralEnglish PDFmemberpjd100125-Apr-06 20:00 
GeneralExplorer Crashes!memberMohammadAmiry2-Sep-05 1:28 
GeneralRe: Explorer Crashes!sitebuilderMichael Dunn2-Sep-05 6:06 
GeneralRe: Explorer Crashes!memberMohammadAmiry2-Sep-05 19:19 
GeneralRe: Explorer Crashes!sitebuilderMichael Dunn2-Sep-05 22:24 
GeneralRe: Explorer Crashes!memberMohammadAmiry4-Sep-05 0:44 
GeneralWin_32sussAnonymous6-Jul-05 14:04 
GeneralRe: Win_32sitebuilderMichael Dunn6-Jul-05 15:05 
GeneralUninstalling shell extension DLL without reboot.memberKalliMan31-May-05 22:20 
GeneralRe: Uninstalling shell extension DLL without reboot.sitebuilderMichael Dunn1-Jun-05 20:18 
GeneralRe: Uninstalling shell extension DLL without reboot.membermmsguru6-Apr-06 22:14 
GeneralRe: Uninstalling shell extension DLL without reboot.sitebuilderMichael Dunn8-Apr-06 13:04 
QuestionHow lnk files are handled.membercondoman21-Apr-05 2:54 
AnswerRe: How lnk files are handled.sitebuilderMichael Dunn21-Apr-05 5:48 
GeneralRe: How lnk files are handled.membercondoman21-Apr-05 7:09 
GeneralDialog Boxes and AfxResourceInstancememberBryanD23-Feb-05 8:27 
GeneralChomp, chomp, chomp...memberBassam Abdul-Baki16-Feb-05 9:23 
GeneralRe: Chomp, chomp, chomp...sitebuilderMichael Dunn17-Feb-05 11:02 
GeneralFoldersmemberHockey18-May-04 3:12 
GeneralAdding a Toolbar Buttonmemberclayton0427-Jan-04 20:18 
GeneralRe: Adding a Toolbar Buttonmember[Anders]9-Feb-04 12:04 
GeneralRe: Adding a Toolbar ButtonsitebuilderMichael Dunn9-Feb-04 12:27 
GeneralRe: Adding a Toolbar Buttonmemberclayton0418-Feb-04 21:02 
GeneralRe: Adding a Toolbar ButtonsitebuilderMichael Dunn19-Feb-04 4:21 
QuestionHow can the virtiual fold be accessible from the File Open Dialog or File Save Dialogmembertellzj14-Sep-03 22:44 
QuestionHow to implement multiple file property page?sussAnonymous8-Aug-03 1:21 
QuestionHow to write a service like "zipped folders" in windowsmemberArtur Sharipov2-Aug-03 6:12 
AnswerRe: How to write a service like "zipped folders" in windowssitebuilderMichael Dunn2-Aug-03 9:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130619.1 | Last Updated 2 Jun 2002
Article Copyright 2000 by Michael Dunn
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid