Skip to content

kof2000git/desktop_box

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗂️ DesktopBox

Free, portable Windows desktop organizer — your open-source Fences alternative.

免费开源的 Windows 桌面整理工具 · 单文件绿色版 · 零联网零遥测

.NET 8 WPF Platform License Single File


一键把桌面散乱文件按类型自动归类进带标签页的盒子 —— 只引用、绝不移动文件,其它程序照常工作。还能把程序/文件/文件夹/网址拖进盒子分类、隐藏桌面图标、用盒子存放此电脑/回收站/控制面板/网络等系统图标。


📑 Table of Contents · 目录


✨ Features · 功能

🇬🇧 English

Feature
🧹 One-click Tidy — Scans your desktop and auto-sorts every file into a tabbed box (Apps / Documents / Images / Videos / Audio / Shortcuts / Archives / Folders / Other). Incremental: only new files on each run.
📌 Reference-only, never moves — The box stores paths, not copies. Your files stay exactly where they were. Scripts and shortcuts that hard-code desktop paths keep working.
📦 Drag-drop boxes — Create custom boxes anywhere, drag in apps/files/folders/URLs, double-click to open. 8-direction resize, edge-snap with hysteresis, multi-monitor clamp.
🗂️ Tabbed boxes — Convert/merge/split boxes into tabbed containers; reorder tabs by drag.
👁️ Hide/Show desktop icons — One toggle clears your real desktop icons (purely visual, no files touched).
🖥️ System-icons box — This PC / Recycle Bin / Control Panel / Network with real system icons.
🖱️ Native shell context menu — Real Windows right-click menu (Open / Properties / Send To / …) via a bundled C++ helper executable.
♻️ Green & portable — A single ~74 MB exe. Config & icon cache live next to the exe; delete everything except the exe and it still runs and regenerates them.
🔒 No telemetry, no network — Never connects anywhere.

🇨🇳 中文

功能
🧹 一键整理 — 扫描桌面,按类型自动归类进标签盒子(应用程序/文档/图片/视频/音频/快捷方式/压缩包/文件夹/其他)。增量:每次只处理新文件。
📌 只引用、绝不移动 — 盒子存的是路径,不是副本。文件原地不动,写死桌面路径的脚本/快捷方式照常工作。
📦 拖放整理盒 — 任意位置建盒子,拖入程序/文件/文件夹/网址,双击打开。8 向缩放、带迟滞的贴边磁吸、多显示器边界限制。
🗂️ 标签盒子 — 盒子可转标签盒子、合并/拆分,标签可拖动排序。
👁️ 隐藏/显示桌面图标 — 一键清空桌面真实图标(纯视觉,不动文件)。
🖥️ 系统图标盒子 — 此电脑/回收站/控制面板/网络,用真实系统图标
🖱️ 原生右键菜单 — 真正的 Windows 右键菜单(打开/属性/发送到/…),由配套 C++ helper EXE 提供。
♻️ 绿色便携 — 单个 ~74MB 的 exe。默认把配置与图标缓存放在exe 同目录;若目录不可写,会自动退到 %LocalAppData%\\DesktopBox
🔒 零联网、零遥测 — 永不联网。

🖼️ Screenshots · 截图

DesktopBox 桌面整理效果

把桌面散乱文件整理进带标签页的盒子(只引用、不移动文件)。 Tidy scattered desktop files into tabbed boxes — reference-only, no files moved.


📦 Download & Install · 下载安装

For end users · 普通用户

Go to Releases and grab one of:

前往 Releases 发布页 下载:

File · 文件 说明
DesktopBox.exe 绿色版(推荐)· 双击即用,免安装,不写注册表 · 74 MB
DesktopBox.ShellMenu.exe 原生右键菜单 helper · 与主程序放同目录(可选,缺少时无原生菜单)
DesktopBoxSetup.exe 安装包 · 一路 Next 即可(向导英文,软件本体中文)

⚠️ SmartScreen 提示? → 点「更多信息 → 仍要运行」。本程序无数字签名,首次会有此提示,纯属正常。 SmartScreen warning? → Click More info → Run anyway. (No code-signing certificate yet; this is expected.)

Requirements · 运行环境

  • Windows 10 / 11 (64-bit)
  • 无需安装 .NET —— 绿色版已自带运行时(self-contained)。

🚀 Usage · 使用

🇬🇧 Quick start

  1. Launch — A blue tray icon appears in the system tray.
  2. Create a box — Right-click the desktop (or tray) → New Box.
  3. Add itemsDrag apps/files/folders/shortcuts/URLs onto a box.
  4. OpenDouble-click an icon.
  5. One-click tidy — Right-click desktop → One-click Tidy → all scattered files sorted into a tabbed box, files stay put.

🇨🇳 快速上手

  1. 启动 — 右下角出现蓝色托盘图标。
  2. 新建盒子 — 桌面空白处右键(或托盘右键)→「新建盒子」。
  3. 放东西 — 把程序/文件/文件夹/快捷方式/网址到盒子上。
  4. 打开双击图标。
  5. 一键整理 — 桌面空白处右键 →「一键整理桌面」→ 散乱文件按类型归入标签盒子,文件原地不动

📖 Full guide · 完整文档: 使用说明.md


🧰 Support · 问题反馈

遇到问题、需要反馈 bug 或交流使用方法,可以加入 QQ 群: 657713542

For bugs, please open an issue with reproduction steps and logs/error.log. Chinese users can also join QQ group 657713542 for support.


🔨 Build from Source · 从源码编译

This project has no pre-built binaries in the repo (they're git-ignored). Compile it yourself with the steps below. 仓库不包含预编译产物(已 gitignore),请用以下步骤自行编译。

Prerequisites · 前置依赖

Tool · 工具 Version · 版本 Purpose · 用途
.NET 8 SDK 8.0+ 主程序 (C# / WPF)
MSVC Build Tools 或 Visual Studio 17.x (含 C++ + Windows SDK) 编译原生右键菜单 helper EXE (C++)
Inno Setup (可选) 6.x 打安装包

Verify · 验证:

dotnet --version        # 需 8.0+
git --version
# C++ 工具链: 在 "Developer Command Prompt for VS" 里
where cl                # 应能找到 cl.exe

1️⃣ Clone · 克隆

git clone https://github.com/kof2000git/desktop_box.git
cd desktop_box

2️⃣ Build & test · 编译并测试

# 编译整个解决方案
dotnet build DesktopBox.sln -c Release

# 运行单元测试
dotnet test DesktopBox.sln

3️⃣ Publish single-file exe · 发布单文件绿色版

dotnet publish src/DesktopBox/DesktopBox.csproj \
  -c Release \
  -r win-x64 \
  --self-contained true \
  -p:PublishSingleFile=true \
  -p:IncludeNativeLibrariesForSelfExtract=true \
  -p:EnableCompressionInSingleFile=true \
  -o publish

This produces a single ~74 MB publish/DesktopBox.exe with the entire .NET runtime + WPF bundled inside.

产出单个 ~74MB 的 publish/DesktopBox.exe,内含完整 .NET 运行时 + WPF。

4️⃣ Build the native shell-menu helper · 编译原生右键菜单 helper

The right-click shell menu is hosted by a small isolated C++ helper executable (DesktopBox.ShellMenu.exe). The build script locates MSVC automatically:

右键菜单由小型、隔离运行的 C++ helper EXE (DesktopBox.ShellMenu.exe) 承载;构建脚本会自动定位 MSVC:

cd src\DesktopBox.ShellMenu
build_dll.bat

This drops DesktopBox.ShellMenu.exe into the publish\ folder. Place it next to DesktopBox.exe.

💡 Without this helper EXE the app still runs fine; right-click simply has no native menu. For full functionality, ship both executables. 💡 没有这个 helper EXE 程序照常运行,只是右键没有原生菜单。要完整功能,两个 EXE 一起分发。

5️⃣ (Optional) Build installer · 打安装包

"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" DesktopBox.iss

→ produces release\DesktopBoxSetup.exe


🏗️ Architecture · 架构

src/
├── DesktopBox/              # Main app (C# / WPF / .NET 8)
│   ├── Models/              # Box, BoxItem, AppConfig, AppPaths …
│   ├── Services/            # Persistence, IconExtractor, Organize,
│   │                        #   DesktopIcons, Theme, persistence …
│   ├── ViewModels/          # MVVM (CommunityToolkit.Mvvm)
│   ├── Views/ & Controls/   # MainWindow, BoxControl, ItemTile …
│   └── Native/              # P/Invoke: Shell32, User32, IImageList …
├── DesktopBox.ShellMenu/    # Native C++ helper EXE — isolated IContextMenu host
│   ├── DesktopBox.ShellMenu.cpp
│   └── build_dll.bat
└── DesktopBox.Tests/        # xUnit regression tests

Key design decisions · 关键设计

  • Desktop-layer boxes — Each box is hosted as a transparent child HWND on the desktop shell view, so desktop menus and normal app windows stay above it while the box remains visible through Win+D and desktop-icon toggles.
  • Reference-only organize — Tidying never calls File.Move; boxes store paths. Zero risk of "lost files".
  • Stable references — If a source file is moved or deleted later, its invalid box reference remains until the user removes it; 失效引用会保留
  • Portable data — Config (boxes.json, organize.json) and icon cache prefer the exe directory; if it is read-only (for example under Program Files), DesktopBox falls back to %LocalAppData%\DesktopBox.
  • Service-layer interfaces + unit tests — Core logic (categorize, organize, persistence) is fully testable; Native/UI layers are manually verified.

Tech stack · 技术栈: .NET 8 · WPF · WPF-UI · CommunityToolkit.Mvvm · WinForms interop · C++/Win32 (shell menu)


❓ FAQ · 常见问题

Q: Did one-click tidy move my files? / 一键整理会移动我的文件吗? No. / 不会。 It only stores file paths in a box. Files stay exactly where they were. 只把文件路径存进盒子,文件原地不动。

Q: Where is my data? / 我的数据在哪? Preferably next to the exe: boxes.json (box layout), organize.json (tidy manifest), icons/ (icon cache), logs/ (error log). If the exe folder is not writable, DesktopBox falls back to %LocalAppData%\DesktopBox. 优先在 exe 同目录:boxes.json(盒子布局)、organize.json(整理清单)、icons/(图标缓存)、logs/(错误日志);若目录不可写,会自动退到 %LocalAppData%\DesktopBox

Q: Back up? / 怎么备份? Copy boxes.json. That's it. 复制 boxes.json 即可。

Q: I deleted everything except the exe — will it still run? / 只剩 exe 还能运行吗? Yes. / 能。 It regenerates config, icon cache and logs automatically. Usually they go next to the exe; on read-only folders they go under %LocalAppData%\DesktopBox. 会自动重建配置、图标缓存和日志;通常放在 exe 旁,若目录只读则放到 %LocalAppData%\DesktopBox

Q: Does it send any data online? / 会联网上传数据吗? Never. / 绝不。 No telemetry, no network calls of any kind. 零遥测、零联网。

📖 More in 使用说明.md.


🤝 Contributing · 参与贡献

Contributions are welcome! · 欢迎贡献!

  • 🐛 Bugs — Open an issue with steps to reproduce + logs/error.log.

  • 🧰 Support — Chinese users can join QQ group 657713542.

  • 💡 Ideas — URL icons, box search, collapsible boxes …

  • 🌍 i18n — Help translate the UI.

  • Star it if it helps you!

  • 🐛 Bug — 提 issue,附复现步骤 + logs/error.log

  • 🧰 反馈交流群 — 有问题可加入 QQ 群 657713542

  • 💡 建议 — 网址图标、盒子搜索、折叠盒子 …

  • 🌍 国际化 — 帮助翻译界面。

  • ⭐ 觉得有用就点个 Star!


📄 License · 许可

MIT © kof2000git

DesktopBox is an independent project. It is not affiliated with, endorsed by, or derived from Stardock Fences. DesktopBox 是独立项目,与 Stardock Fences 无任何关联。

⭐ If this project helps you, please give it a star! / 如果对你有帮助,请点个 Star! ⭐

About

Free, portable Windows desktop organizer. One-click tidy sorts files into tabbed boxes WITHOUT moving them. Drag-drop boxes, native shell menus, hide desktop icons. Single 71MB exe, no telemetry. Open-source Fences alternative. .NET 8 + WPF.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors