关于如何实现启动另一个exe程序
想用c++实现做一个程序,这个程序来启动另一个exe文件.
请问怎么实现
PROCESS_INFORMATION processinfo;
if(!CreateProces(g_strGpsExePath,NULL,NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,NULL,&processinfo))
{
RETAILMSG(1, (TEXT("CreateProcess::Gps.Exe----failed.\r\n")));
}
if(!ResumeThread(processinfo.hThread))
{
RETAILMSG(1, (TEXT("ResumeThread::Gps.Exe----failed.\r\n")));
}
//g_strGpsExePath-----exe的路径字符串
SHELLEXECUTEINFO info;
info.cbSize = sizeof(info);
info.fMask = SEE_MASK_NOCLOSEPROCESS;
info.lpVerb = NULL;
info.lpFile = TEXT("MyApp.exe");
info.lpParameters = NULL;
info.lpDirectory = NULL;
info.nShow = SW_SHOW;
info.hInstApp = NULL;
ShellExecuteEx( &info );