Creating the InfoTip Shell Extension, which lets us, control the information that appears in Explorer when the mouse hovers over a file. Creating a Delphi Infotip that will display the FileName, the project type (Program or Library), the Project Name (from the source file), and the size of the file in bytes.
Article submitted by: Larry J. Rutledge
With each new release of Windows, its shell becomes more and more advanced and adds many new useful features. One of the ways this is done is through shell extensions. These extensions allow developers to add functionality to the existing Windows shell. Some examples of shell extensions are Context Menus (menus that change based on what object has focus when you right-click), Property Sheet Handlers (tabbed pages that appear when the Properties menu item is selected from an object’s context menu), Icon Overlays (appear as the arrow on top of an icon that points to a shortcut or the hand that appears on shared folders), Folder Customization, and many, many more.
Over the course of a few articles we will examine several of these extensions and, in particular, how to build them in Delphi. There is plenty of information about shell extensions available from the Microsoft web site, but these articles will bring it to the Delphi audience. In this first article we will look at the InfoTip Shell Extension, which lets us control the information that appears in Explorer when the mouse hovers over a file.
Important Note
The following paragraph from Dino Esposito’s article, "Windows 2000 UI Innovations: Enhance Your User’s Experience with New Infotip and Icon Overlay Shell Extensions" (MSDN Magazine, March 2000) is a good description of what versions of Windows these extensions apply to:
"…I should point out that not all the features I'll cover here are completely new. Many of them were already introduced with the Desktop Update – a separate shell update available both for Windows 9x and Windows NT 4.0. The Desktop Update shipped with Microsoft Internet Explorer 4.0 and Windows 98. Note that the Desktop Update is not part of Internet Explorer 5.0. So if you want to install it on Windows NT 4.0, you need to install Internet Explorer 4.0 first, making sure you select the Desktop Update option. Internet Explorer 5.0 will upgrade an existing Desktop Update on Windows NT 4.0 and Windows 95, but will not install it from scratch."
Shell Extension – Quick Overview
Shell Extensions are implemented as In Process COM servers. Windows Explorer invokes the appropriate extension in response to shell-wide events. Explorer was designed to respond in very specific ways when the user performs various functions within its shell. The first thing Explorer does is check for any modules that have been registered for a specific event and if one exists it attempts to load the module.
To be a valid shell extension, the COM server must implement an interface that defines the specific behavior for the desired extension and it must implement an interface that defines its initialization behavior. Finally, to be a valid shell extension, the COM server must follow the approved method of registering itself with the system.
The following table from Dino Esposito's article "Windows 2000 UI innovations: Enhance Your User's Experience with New Infotip and Icon Overlay Shell Extensions" (MSDN Magazine, March 2000), lists all the types of shell extensions available today, the minimum shell version each requires, the involved interfaces, and a brief description: