mirror of
https://github.com/wangdage12/genshin-fps-unlock.git
synced 2026-02-17 09:22:08 +08:00
添加传递命令行的功能
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
|
.vs/
|
||||||
*.exe
|
*.exe
|
||||||
|
|||||||
@@ -682,7 +682,15 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
STARTUPINFOA si{};
|
STARTUPINFOA si{};
|
||||||
PROCESS_INFORMATION pi{};
|
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();
|
DWORD code = GetLastError();
|
||||||
printf("CreateProcess failed (%d): %s", code, GetLastErrorAsString(code).c_str());
|
printf("CreateProcess failed (%d): %s", code, GetLastErrorAsString(code).c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user