How Windows 98 Processed Desktop Theme Files

In Microsoft Windows 98, user desktop theme files (.theme) were plain-text configuration files that allowed users to completely customize their graphical user interface, including color palettes, desktop backgrounds, screensavers, sound events, mouse pointers, and desktop icons. Windows 98 processed these files via the integrated Desktop Themes utility, which parsed the theme's initialization directives, updated the corresponding Windows Registry entries, and broadcast system-wide API notifications to refresh active UI elements without requiring a system reboot.

The Anatomy of a .theme File

A .theme file was structured identically to a standard Windows initialization (.ini) file. It contained discrete sections bracketed by headers, with key-value pairs defining specific system properties and paths to linked multimedia assets:

  • [Control Panel\Colors]: Defined RGB values for user interface elements such as active title bars, window backgrounds, menu text, tooltips, and 3D borders.
  • [Control Panel\Desktop]: Specified parameters for the desktop wallpaper (file path, tiling, and stretching options), alongside the path to the associated screen saver executable (.scr).
  • [Control Panel\Cursors]: Mapped static (.cur) and animated (.ani) cursor files to pointer states like the standard arrow, wait cursor, and resize arrows.
  • [Sounds]: Linked specific audio assets (.wav) to system events, such as system startup, window minimize, asterisk, and critical stop.
  • [CLSID]: Mapped custom icons (.ico or icon resources within .dll files) to shell namespaces, including My Computer, Network Neighborhood, and the Recycle Bin (both empty and full states).
  • [Metrics]: Contained structural metrics like caption bar heights, scroll bar widths, and font specifications (e.g., MS Sans Serif or Tahoma sizes and weights).

Parsing via the Desktop Themes Architecture

Windows 98 handled .theme files primarily through the Desktop Themes application (THEMES.EXE), accessible via the Control Panel or the Display Properties applet. Originally introduced in the Microsoft Plus! 95 pack, this utility was integrated directly into Windows 98.

When a user selected or double-clicked a .theme file:

  1. Reading File Structures: The engine used standard Win32 profile-reading APIs (such as GetPrivateProfileString) to read the designated .theme file located typically within the C:\Program Files\Plus!\Themes or C:\Windows\Application Data\Microsoft\Themes directories.
  2. Asset Verification: The program verified the existence of referenced media files. If an asset had a relative path or a missing file, it fell back to default Windows resources.
  3. Selective Application: The Desktop Themes interface allowed users to preview changes and selectively uncheck components (e.g., applying colors and icons while leaving sounds unchanged). The parser checked these user flags before writing changes.

Writing to the Windows Registry

Once applied, the Desktop Themes engine translated the parsed key-value pairs directly into user configuration hives inside the Windows Registry (HKEY_CURRENT_USER):

  • Color settings were written to HKEY_CURRENT_USER\Control Panel\Colors.
  • Sound profiles were written to HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default.
  • Cursor assignments were written to HKEY_CURRENT_USER\Control Panel\Cursors.
  • Custom icons were updated under the corresponding shell CLSID keys located at HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{GUID}\DefaultIcon.

System-Wide Application and Notification

Writing the data to the registry was not enough on its own to update the live environment. To apply the visual and auditory changes immediately, Windows 98 executed several Win32 API calls:

  1. SetSysColors: Called to immediately recalculate and apply the RGB values for the active user session.
  2. SystemParametersInfo: Called with flags such as SPI_SETDESKWALLPAPER to update the desktop image, SPI_SETSCREENSAVEACTIVE to change the screensaver, and SPI_SETNONCLIENTMETRICS to resize borders, title bars, and system fonts.
  3. Message Broadcasting: The utility broadcasted standard Windows messages, specifically WM_SYSCOLORCHANGE and WM_SETTINGCHANGE (previously WM_WININICHANGE), to all top-level windows (HWND_BROADCAST).

Upon receiving these messages, running applications, the Windows Explorer shell, and the desktop process cleared their cached UI properties and redrew their client and non-client regions to reflect the new theme instantly.