This commit is contained in:
睿 安
2026-01-25 23:46:14 +08:00
parent 2a2a3d68d8
commit 37e7d278bd
727 changed files with 193377 additions and 7 deletions

42
demo/ResPackage/main.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include "mainFrom.h"
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
//格式化命令行参数
int argc = 0;
LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
std::vector<UIString> args;
for (int i = 0; i < argc; i++) {
args.emplace_back(argv[i]);
}
LocalFree(argv);
// 查找 "-package" 参数
auto it = std::find(args.begin(), args.end(), L"-package");
if (it != args.end()) {
size_t index = std::distance(args.begin(), it);
UIString packageDir = args[index + 1];
UIString outFile = args[index + 2];
UIString log = UIString("packaging... %s -> %s \n").format(packageDir.c_str(), outFile.c_str()).ansi();
printf(log.c_str());
bool bRet = Resource::Package(packageDir, outFile);
if (bRet) {
printf("package succeeded !");
}
else {
printf("package failed !");
}
return 0;
}
Application app;
app.EnableHighDpi();
MainFrm frm(lpCmdLine);
frm.Show();
return app.Exec();
};