Custom icons for virtual disks in Explorer (OS edition, Windows platform)

CBFS Storage lets you create custom icon for your virtual disk. This icon is shown by Windows Explorer.

Custom icons are implemented using icon overlay mechanism and are restricted to 25% of original icon size (except 16x16 icons). Overlay icons map as follows:

Icon files must have the following color levels:

Before the icon can be used (set) it needs to be installed using InstallIcon method. This method should be executed by the process running under Administrator account or with elevated rights.

During installation the icon is copied to the temporary file, which will be removed after deinstallation of the icon using UninstallIcon method. Then you can set the icon using SetIcon method.

For custom icons to work you need to include CBFSStorageMntNtf2017.dll to the list of modules installed using Install method.

One limitation of Windows is that it supports just 15 overlay icons in the registry and some applications (e.g. OneDrive, Dropbox) install multiple overlays. So there's a competition between applications to display their overlays. The overlays are placed in Windows registry, in this key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers (on 64-bit Windows you need to check HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\explorer\ShellIconOverlayIdentifiers as well). If you need to remove some icons to free space for yours, it's up to your application's installer or the user themselves to do this.