1、概述
启动进程,并返回新进程id,支持场景:
1、支持绝对路径: C:\Program Files\Google\Chrome\Application\chrome.exe
2、支持环境变量路径:%localappdata%\\Feishu\\Feishu.exe
1.1、调用示例
// 调用示例 // 启动进程,并返回新进程id // 支持绝对路径: C:\Program Files\Google\Chrome\Application\chrome.exe // 支持环境变量路径:%localappdata%\\Feishu\\Feishu.exe DWORD dwPid = 0; std::wstring exePath = L"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"; // std::wstring exePath = L"%localappdata%\\Feishu\\Feishu.exe"; MyUtil::StartProcess(exePath, L"", dwPid); std::cout << "dwPid:" << dwPid << std::endl;1.2、源码
bool MyUtil::StartProcess(const std::ws