Windows 98 Desktop Context Menu Customization
This article examines how Microsoft Windows 98 handled customizations for the desktop right-click context menu. Driven by the Windows Explorer shell architecture and the newly integrated Active Desktop components, Windows 98 processed these customizations through a combination of Windows Registry keys, static shell verbs, and dynamically loaded Component Object Model (COM) shell extensions.
In Windows 98, the desktop functioned as a virtual shell folder
mapped to both the file system directory
(C:\Windows\Desktop) and the root of the shell namespace.
When a user right-clicked on an empty area of the desktop, the operating
system's shell process (explorer.exe) initiated an event to
assemble the context menu dynamically rather than displaying a static,
hardcoded list.
The customization process relied primarily on the Windows Registry.
Windows 98 checked specific paths under HKEY_CLASSES_ROOT
to determine which menu items to display:
- Static Verbs: Developers and administrators could
add basic command entries under
HKEY_CLASSES_ROOT\Directory\Background\shellorHKEY_CLASSES_ROOT\Folder\shell. Each subkey represented a menu label, containing acommandsubkey specifying the executable path and arguments to run when clicked. - Shell Extensions: Dynamic customizations were
registered under
HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers. Here, keys pointed to the unique Class Identifier (CLSID) of an in-process COM server (a DLL) registered inHKEY_CLASSES_ROOT\CLSID.
When generating the desktop context menu, Windows 98 executed a structured sequence via COM interfaces:
- Instantiation and Initialization: The shell queried
the Registry for registered handlers and called
CoCreateInstanceto load the corresponding DLLs into theexplorer.exeaddress space. It then queried each object for theIShellExtInitinterface, callingIShellExtInit::Initializeto pass context data, such as a pointer to an item identifier list (PIDL) representing the desktop background. - Menu Construction: The shell queried the object for
the
IContextMenu(orIContextMenu2/IContextMenu3) interface and invokedQueryContextMenu. This method allowed the extension to insert custom menu items, set flags (such as grayed or checked states), and create submenus dynamically. - Rendering: Once all registered handlers contributed
their items, Windows 98 displayed the compiled menu using the Win32
TrackPopupMenuExAPI. If owner-drawn items or submenus were present, messages likeWM_INITMENUPOPUPorWM_DRAWITEMwere routed back to the extension viaIContextMenu2::HandleMenuMsg. - Execution: When the user selected an item, the
shell invoked
IContextMenu::InvokeCommand, passing a structure containing the command's verb or menu identifier offset, prompting the handler to execute the requested action.
Windows 98 also introduced full integration with Internet Explorer
4.0's Shell Update Release, which added the Active Desktop layer.
Because of this integration, the desktop was hosted by an updated
desktop view component (IShellView) that automatically
incorporated native Active Desktop commands—such as "Active Desktop",
"Arrange Icons", and "Line Up Icons"—before aggregating external
Registry-based context menu handlers.