Desktop Disk Icon
Displays external storage devices as native desktop icons
Author: Raku Inkyetta
中文描述在下方,请继续向下滚动查看。
English first; the Chinese section is at the bottom.
Renders external storage devices as native Windows desktop icons, in a manner comparable to how
mounted volumes appear on the macOS desktop.
Features
- Covers USB flash drives, external hard disks and SSDs, optical media (CD/DVD/Blu-ray and
mounted ISO images), floppy disks and memory cards.
- Only volumes are shown, matching macOS: phones (MTP/PTP, iPhone) are not mounted as volumes
and therefore never appear on the desktop.
- Icons are taken from the volume itself. The shell derives them from the volume label,
autorun.inf or the device description; the mod never substitutes its own icons.
- Icon names combine the volume label with the drive letter. When the label is empty, the
device type name reported by the shell is used, for example
U 盘 (F) or CD-ROM (H).

How it works
By default the mod registers a shell namespace item for each drive. Such an item belongs to the
same category of desktop objects as "This PC" and "Recycle Bin": no .lnk file is created on
the desktop and no shortcut arrow is drawn. The item is registered through the shell's built-in
delegated folder (InProcServer32 is shell32.dll, Instance\InitPropertyBag\TargetFolderPath
is the volume), so the shell uses its own folder object: no mod code is loaded by the shell or by
any other process, and the item behaves exactly like a built-in folder.
The mod runs inside explorer.exe, listens for the shell's drive and media change
notifications, and additionally polls at a configurable interval. Every synchronization pass
brings the desktop icons in line with the devices that are currently attached.
Cleanup behaviour
- Nothing is written to the system registry. The item definitions live in a private hive
(
RegLoadAppKey) inside the mod's storage, and four registry read hooks redirect Explorer's
reads of Desktop\NameSpace and Software\Classes\CLSID to that hive. The items therefore exist
only inside Explorer and vanish as soon as the mod is unloaded.
- The bookkeeping values the shell writes under
Shell Extensions\Cached are removed on unload.
- Unplugging a device deletes the corresponding item; disabling or uninstalling the mod deletes
every item created by it.
- The mod only acts in the Explorer process that owns the desktop window; other
explorer.exe
instances (folder windows in a separate process, explorer.exe /select, and similar short-lived
processes) are skipped, so the hooks never run there and those windows do not show the items.
- Updating the mod takes effect immediately; no Explorer restart is required, because the item is
served by the shell itself.
Known limitations
- External hard disks are recognised by bus type (USB, IEEE 1394, SD/MMC, virtual). Disks attached
through Thunderbolt or eSATA that report an internal bus may not be recognised; internal disks are
never shown.
- Portable devices (MTP/PTP, and phones in general) are not shown, because they are not volumes.
- Removing a device deletes its icon immediately; there is no eject command. Use the system tray
safe-removal function before unplugging.
- If plugging or unplugging a disk does not update the desktop, set the polling interval to about
10 seconds in the settings.
Links
中文部分
功能
- 覆盖 USB 闪存盘、外接硬盘与固态硬盘、光盘(CD/DVD/蓝光及已挂载的 ISO 映像)、软盘、
存储卡。
- 只显示「卷」,与 macOS 一致:手机(MTP/PTP、iPhone)不会被挂载成卷,因此不会出现在桌面。
- 图标取自磁盘本身,由系统依据卷标、
autorun.inf 或设备描述提供,模组不做替换。
- 图标名称由卷标与盘符组合而成;卷标为空时采用系统提供的设备类型名称,
例如
U 盘 (F)、CD-ROM (H)。
实现方式
默认情况下,模组为每个驱动器注册一个 shell 命名空间项,与“此电脑”“回收站”属于同一类桌面
对象:桌面不产生 .lnk 文件,也不显示快捷方式箭头。该项通过 shell 自带的委托文件夹注册
(InProcServer32 为 shell32.dll,Instance\InitPropertyBag\TargetFolderPath 为该卷根
目录),因此使用的是系统自己的文件夹对象:shell 与其他进程都不会加载模组代码,行为与系统
内置文件夹完全一致。
模组运行于 explorer.exe,监听 shell 的驱动器与介质变更通知,并以定时轮询作为补充;
每次同步均使桌面图标与当前设备状态保持一致。
清理行为
- 不写系统注册表。 项的定义放在模组存储目录下的私有 hive 中(
RegLoadAppKey),并用 4 个
注册表读取 hook 把资源管理器对 Desktop\NameSpace 与 Software\Classes\CLSID 的读取重定向
到该 hive。因此这些项只存在于资源管理器内部,模组卸载后立即消失。
- 资源管理器写进
Shell Extensions\Cached 的书签值会在卸载时清除。
- 拔出设备时删除对应项;禁用或卸载模组时删除全部由本模组创建的项目。
- 模组只在拥有桌面窗口的资源管理器进程中工作;其他
explorer.exe 实例(在单独进程中打开
文件夹窗口、explorer.exe /select, 等短命进程)会被跳过:hook 不会装在那里,那些窗口也
不会显示这些项。
- 更新模组即时生效,无需重启资源管理器(项本身由系统实现)。
已知限制
- 外接硬盘依据设备总线类型识别(USB、IEEE 1394、SD/MMC、虚拟);雷雳或 eSATA 接口且被报告为
内置总线的硬盘可能无法识别,内置磁盘始终不会显示。
- 便携设备(MTP/PTP 及手机)不显示,因为它们不是卷。
- 拔出设备时直接移除图标,不提供弹出操作;请沿用系统托盘中的安全删除功能。
- 若插拔磁盘后桌面未更新,可在设置中将轮询间隔设为 10 秒左右。
相关链接