From 6ff11aeb26bd2971f7412d753f51cc62550fbfa9 Mon Sep 17 00:00:00 2001 From: fanbook-wangdage <124357765+fanbook-wangdage@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:32:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=A0=E9=80=92=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=A1=8C=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + unlockfps/main.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index eb7f048..3a3e1c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode/ +.vs/ *.exe diff --git a/unlockfps/main.cpp b/unlockfps/main.cpp index 5a08f05..132b4bd 100644 --- a/unlockfps/main.cpp +++ b/unlockfps/main.cpp @@ -682,7 +682,15 @@ int main(int argc, char** argv) STARTUPINFOA si{}; PROCESS_INFORMATION pi{}; - if (!CreateProcessA(ProcessPath.c_str(), (LPSTR)CommandLine.c_str(), nullptr, nullptr, FALSE, 0, nullptr, ProcessDir.c_str(), &si, &pi)) + + // 构建完整的命令行:可执行文件路径 + 参数 + std::string FullCommandLine = "\"" + ProcessPath + "\""; + if (!CommandLine.empty()) + { + FullCommandLine += " " + CommandLine; + } + + if (!CreateProcessA(nullptr, (LPSTR)FullCommandLine.c_str(), nullptr, nullptr, FALSE, 0, nullptr, ProcessDir.c_str(), &si, &pi)) { DWORD code = GetLastError(); printf("CreateProcess failed (%d): %s", code, GetLastErrorAsString(code).c_str());