最后是源代码: [ol]#define _CRT_SECURE_NO_WARNINGS // 禁用安全警告 (解决 C4996) #define _CRT_NON_CONFORMING_WCSTOK // 允许使用旧版双参数 wcstok #include #include #pragma comment(lib, "User32.lib") #pragma comment(lib, "Shell32.lib") #pragma comment(lib, "Gdi32.lib") #pragma comment(lib, "Kernel32.lib") // 纯手写结构体,不依赖 STL struct AppNode { wchar_t name[64]; wchar_t path[MAX_PATH]; int level; HICON hIcon; }; // 全局静态数组(简单处理,假设最多 50 个条目) AppNode g_nodes[50]; int g_nodeCount = 0; HFONT hFontMain = NULL; bool g_visible = false; int g_menuHeight = 600; int g_menuWidth = 450; // 1. 原生文件解析:手动处理换行和缩进 void LoadConfig() { for (int i = 0; i 1) ? (g_menuHeight - 60) / (g_nodeCount - 1) : 55; if (spacing > 60) spacing = 60; for (int i = 0; i 1) ? (g_menuHeight - 60) / (g_nodeCount - 1) : 55; if (spacing > 60) spacing = 60; int idx = (my - 20) / spacing; if (idx >= 0 && idx 复制代码