Kinds of Shell Extensions
Since our topic is the combination of shell programming and COM, we’ll focus on building the following shell extensions, all of which rely on COM interfaces to be loaded and invoked by the shell:
- Context menu handlers
A context menu is the pop-up menu that appears when you right-click on an object in Explorer. A context menu handler allows you to customize that menu by adding your own items to it. For instance, if you develop an application that stores thumbnails of graphics files, you might add an “Add to Thumbnail” option to the context menu of any supported graphics file. When the user selects the file, it is automatically added to the application’s current thumbnail.
- Drag-and-drop handlers
These are specialized context menu handlers; they control the pop-up menu that appears when a shell object is dragged and dropped using the right mouse button.
- Icon handlers
Ordinarily, each file type has its own icon. For instance, every Word document is represented by a single icon that serves to identify it. An icon handler, though, allows you to define an icon for an individual instance of that file based on some attribute or condition of the file (its contents, its size, the date it was created, etc.). A classic example is the icon for the Recycle Bin: when it is empty, the Recycle Bin is represented by an empty trash can; when it is not empty, the Recycle Bin is represented by an overflowing trash can.
- Property page extension
Every shell object has a Properties ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access