Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DesktopIconMover

通过 DLL 注入与共享内存 IPC,远程控制 Windows 桌面图标布局

C++17 Windows 10+ VS2022 Apache 2.0


功能

  • 保存/加载图标布局 — 将桌面图标位置保存到文件,随时恢复
  • 比率坐标 — 坐标以屏幕分辨率比率表示,跨分辨率自动适配
  • 排序布局 — 按 X/Y 坐标升序/降序排列图标
  • 内置点云数据 — 内置「生日快乐」文字点云,一键将图标排列成文字图案
  • 禁用自动排列 & 对齐网格 — 自动关闭桌面图标的自动排列与网格对齐
  • 刷新桌面 / 显示桌面 — 刷新桌面图标或模拟 Win+D
  • 清理临时文件 — 一键清理程序创建的桌面占位文件
  • HTA 图形界面 — 提供开箱即用的 GUI 操作面板

架构

┌──────────────┐      共享内存 + 命名事件 + 互斥锁      ┌──────────────────┐
│  Mover.exe   │  ◄──────────── IPC ──────────────►  │  Agent.dll       │
│  (主程序)     │      Local\DesktopIconMover*        │  (explorer.exe)  │
└──────────────┘                                      └──────────────────┘
       │
       ├── CommandLine.hpp   命令行解析与命令模式
       ├── DataManager.hpp   数据读写与排序
       ├── Mover.hpp         DLL 注入 & IPC 客户端
       └── BuiltIn-Data.lib  内置点云数据集

       ┌──────────────────┐
       │  Agent.dll       │
       │  (explorer.exe)  │
       ├── DLL_Mover.hpp  IPC 服务端 & 图标操作
       └── tool/A.hpp     COM 接口 & 桌面视图操作

通信机制: Mover.exe 通过 CreateFileMappingW 创建共享内存,配合命名事件 (CmdEvent / RspEvent) 和互斥锁实现与注入到 explorer.exe 中的 Agent.dll 的同步 IPC 通信。

DLL 注入: 使用 VirtualAllocEx + WriteProcessMemory + CreateRemoteThread 将 Agent.dll 注入到 explorer.exe 进程。

构建要求

  • Visual Studio 2022 (v143 工具集)
  • Windows SDK 10.0
  • C++ ATL 库

构建

  1. 用 Visual Studio 2022 打开 DesktopIconMover.sln
  2. 选择 Release | x64 配置
  3. 生成解决方案
  4. 确保 Mover.exeAgent.dll 在同一目录

使用

命令行

# 保存当前桌面图标布局
Mover.exe --mode=save --file=my_layout.bin --output

# 加载布局并移动图标
Mover.exe --mode=move --file=my_layout.bin

# 使用内置「生日快乐」点云
Mover.exe --mode=move --file=mover::happybirthday

# 保存完整图标数据(名称 + 坐标)
Mover.exe --mode=save-full --file=full_data.bin

# 排序布局文件
Mover.exe --mode=sort --sort=X_ASC --file=layout.bin

# 清理桌面占位文件
Mover.exe --mode=clear

# 卸载 DLL
Mover.exe --inject=unset

# 重启资源管理器
Mover.exe --mode=restart-explorer

命令行参数

参数 说明 默认值
--mode save / save-full / move / sort / clear / clearlog / restart-explorer
--file 布局文件路径,支持 mover::happybirthday 内置数据 .\rikka.bin
--sort X_ASC / X_DESC / Y_ASC / Y_DESC
--inject true / false / auto / unset auto
--output 输出结果到控制台
--no-footprint 执行后自动卸载 DLL
--help 显示帮助

GUI

双击 GUI\HTA\GUI.hta 打开图形界面。

注意事项

  • 需要 Windows 10 及以上
  • 建议以管理员身份运行
  • 请关闭桌面图标的「自动排列」和「将图标与网格对齐」功能
  • 第三方桌面工具可能导致功能异常

项目结构

DesktopIconMover/
├── DesktopIconMover.sln
├── Mover/                  # 主程序 (EXE)
│   ├── Main.cpp
│   ├── Mover.hpp           # DLL 注入 & IPC 客户端
│   ├── CommandLine.hpp     # 命令行解析
│   ├── DataManager.hpp     # 数据管理
│   └── common/
│       ├── communication.h # IPC 共享数据结构
│       └── icon.h          # 图标数据结构
├── Agent/                  # 注入 DLL
│   ├── Dllmain.cpp
│   ├── DLL_Mover.hpp       # IPC 服务端 & 图标操作
│   └── tool/
│       ├── A.hpp           # COM 接口
│       └── LogMessage.hpp
├── BuiltIn-Data/           # 内置数据集 (LIB)
│   ├── BuiltIn-Data.cpp
│   └── BuiltIn-Data.h
└── GUI/

License

Apache License 2.0

About

Windows 桌面图标布局Manager:通过 DLL 注入与共享内存 IPC 远程控制桌面图标布局 — 也就是说可以在桌面上画画

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages