#include <stdio.h>
#include <windows.h>
bool runexe(TCHAR szPath[])
{
STARTUPINFO stStartUpInfo;
::memset(&stStartUpInfo, 0 ,sizeof(stStartUpInfo));
stStartUpInfo.cb = sizeof(stStartUpInfo);
PROCESS_INFORMATION stProcessInfo;
::memset(&stProcessInfo, 0 ,sizeof(stProcessInfo));
TCHAR szCmd[] = (L" ");
bool bRet = ::CreateProcess(szPath,szCmd,NULL,NULL,false,CREATE_NEW_CONSOLE,NULL,NULL,&stStartUpInfo,&stProcessInfo);
if (bRet)
return true;
else
return false;
}
C++20行代码函数实现打开另一个exe程序
最新推荐文章于 2023-06-26 21:35:54 发布