mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-05-10 02:09:46 +08:00
6a22202ce5
- 删除旧版iup-3.31_Win64_dllw6_lib目录及其所有二进制文件 - 将IUP和CD库重新组织为独立目录结构,包含头文件和静态库 - 更新CMakeLists.txt以链接新的静态库(iupcontrols、iupimglib、cd等) - 修改main.c以显式初始化IupControls和IupImageLib扩展库 - 更新回调函数签名以匹配IUP Matrix控件的实际参数 - 调整UI工具函数以使用Matrix控件的属性(MARKED、NUMLIN等) - 更新安装脚本仅复制实际依赖的DLL文件 - 添加所有缺失的IUP和CD头文件以支持完整功能
78 lines
1.8 KiB
C
78 lines
1.8 KiB
C
#include <iup.h>
|
|
#include <iupcontrols.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "globals.h"
|
|
#include "utils.h"
|
|
#include "registry.h"
|
|
#include "ui.h"
|
|
#include "cb_main.h"
|
|
|
|
/*
|
|
!编译命令:
|
|
cmake -B build -G "MinGW Makefiles"
|
|
cmake --build build
|
|
|
|
!打包命令:
|
|
build_installer.bat
|
|
*/
|
|
|
|
// 主函数
|
|
int main(int argc, char **argv)
|
|
{
|
|
// 初始化 IUP
|
|
if (IupOpen(&argc, &argv) == IUP_ERROR)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
// 初始化扩展库
|
|
IupImageLibOpen();
|
|
IupControlsOpen();
|
|
|
|
// 开启 UTF-8 支持
|
|
IupSetGlobal("UTF8MODE", "YES");
|
|
|
|
// 启用 UIPI 绕过,允许拖拽
|
|
HMODULE hUser32 = LoadLibraryA("user32.dll");
|
|
if (hUser32)
|
|
{
|
|
typedef BOOL(WINAPI * ChangeWindowMessageFilterProc)(UINT, DWORD);
|
|
ChangeWindowMessageFilterProc pChangeWindowMessageFilter = (ChangeWindowMessageFilterProc)GetProcAddress(hUser32, "ChangeWindowMessageFilter");
|
|
if (pChangeWindowMessageFilter)
|
|
{
|
|
// WM_DROPFILES = 0x0233, WM_COPYDATA = 0x004A, MSGFLT_ADD = 1
|
|
pChangeWindowMessageFilter(0x0233, 1);
|
|
pChangeWindowMessageFilter(0x004A, 1);
|
|
}
|
|
FreeLibrary(hUser32);
|
|
}
|
|
|
|
// 初始化历史栈
|
|
init_history_stack(&undo_stack);
|
|
init_history_stack(&redo_stack);
|
|
|
|
// 创建主界面
|
|
dlg = create_main_dialog();
|
|
|
|
// 设置全局按键回调 (如果在 ui.c 中未设置)
|
|
IupSetCallback(dlg, "K_ANY", (Icallback)dialog_k_any_cb);
|
|
|
|
// 加载数据
|
|
if (!check_admin())
|
|
{
|
|
IupMessage("警告", "未检测到管理员权限!\n您可能无法保存更改。\n请右键以【管理员身份运行】。");
|
|
}
|
|
|
|
load_all_paths();
|
|
|
|
// 显示对话框
|
|
IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
|
|
|
|
// 进入主循环
|
|
IupMainLoop();
|
|
|
|
// 清理资源
|
|
IupClose();
|
|
return 0;
|
|
} |