This article provides a step-by-step tutorial to create an icon overlay for the Windows Explorer using Delphi. This is called an Icon Overlay Shell Extension which provides a small graphical overlay to the file icons in the Windows Explorer.

The figure beside shows the result of the coding: the MyIconOverlay - it dispalys the black stamp icon as on overlay to all .log and .txt file-icons.

You need the Embarcadero Delphi programming environment. No special features or libraries are required.

You do not need special knowledge beside some basic knowledge how to create, compile and run a code in Delphi.

This tutorial will provide step-by-step guidance to generate and code a COM Object compiled into a Dynamic Link Library (DLL) which will hold the functions and code to make the Shell Extension. The tutorial will also give some guidance required to compile and register the DLL, and all necessary steps to un-register the DLL to be able to re-compile updated code.

Be careful: The Windows Explorer provides the full Windows view including the Desktop and Taskbar etc. The Shell Exension code could crash the Explorer and you basically loose the basic user Windows GUI functionality. If something goes completely wrong and the Explorer does not start anymore, start the Windows Task-Manager <Ctrl-Alt-Del> select Task-Manager, then start the Registry Editor by starting a new task <regedit>, and remove the registry key which tells Explorer to call whenever an icon is diplayes: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers\MyIconOverlay

After that you can restart the Explorer through the Task-Manager <explorer>.


Tutorial Structure

The tutorial is structured in the following parts to keep it easier for you to understand and follow the necessary steps. Part 1 is the most complex one as it provides all the necessary background to create an Active-X COM Object, how to register the produced DLL, and more cumbersome how to un-register the DLL to be able to re-compile the code.