mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 02:09:46 +08:00
feat: 添加 Windows 环境变量编辑器 GUI 应用程序
- 基于 IUP GUI 库开发 Windows 环境变量编辑器 - 实现 PATH 变量的加载、编辑、保存功能 - 提供新建、编辑、浏览、删除、上下移动路径等操作 - 添加管理员权限检查,确保系统变量修改权限 - 包含完整的项目构建配置(Makefile)和依赖库
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#ifndef CALLBACKS_H
|
||||
#define CALLBACKS_H
|
||||
|
||||
#include <iup.h>
|
||||
|
||||
int btn_new_cb(Ihandle* self);
|
||||
int btn_edit_cb(Ihandle* self);
|
||||
int btn_browse_cb(Ihandle* self);
|
||||
int btn_del_cb(Ihandle* self);
|
||||
int btn_up_cb(Ihandle* self);
|
||||
int btn_down_cb(Ihandle* self);
|
||||
int btn_ok_cb(Ihandle* self);
|
||||
int btn_cancel_cb(Ihandle* self);
|
||||
int btn_help_cb(Ihandle* self);
|
||||
|
||||
#endif // CALLBACKS_H
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef GLOBALS_H
|
||||
#define GLOBALS_H
|
||||
|
||||
#include <iup.h>
|
||||
|
||||
// 注册表路径常量
|
||||
#define REG_PATH L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
|
||||
#define REG_VALUE L"Path"
|
||||
|
||||
// 全局控件句柄声明
|
||||
extern Ihandle *dlg; // 主对话框句柄
|
||||
extern Ihandle *list_path; // 路径列表控件句柄
|
||||
extern Ihandle *lbl_status; // 状态标签句柄
|
||||
extern Ihandle *btn_new; // 新增按钮句柄
|
||||
extern Ihandle *btn_edit; // 编辑按钮句柄
|
||||
extern Ihandle *btn_browse; // 浏览按钮句柄
|
||||
extern Ihandle *btn_del; // 删除按钮句柄
|
||||
extern Ihandle *btn_up; // 上移按钮句柄
|
||||
extern Ihandle *btn_down; // 下移按钮句柄
|
||||
extern Ihandle *btn_ok; // 确认按钮句柄
|
||||
extern Ihandle *btn_cancel; // 取消按钮句柄
|
||||
extern Ihandle *btn_help; // 帮助按钮句柄
|
||||
|
||||
#endif // GLOBALS_H
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef REGISTRY_H
|
||||
#define REGISTRY_H
|
||||
|
||||
// 从注册表加载PATH到列表控件
|
||||
void load_path();
|
||||
|
||||
// 将列表控件中的PATH保存回注册表
|
||||
void save_path();
|
||||
|
||||
#endif // REGISTRY_H
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <wchar.h>
|
||||
|
||||
// 宽字符转UTF-8
|
||||
char* wide_to_utf8(const wchar_t* wstr);
|
||||
|
||||
// UTF-8转宽字符
|
||||
wchar_t* utf8_to_wide(const char* str);
|
||||
|
||||
// 检查管理员权限
|
||||
int check_admin();
|
||||
|
||||
#endif // UTILS_H
|
||||
Reference in New Issue
Block a user