#include "stdafx.h"
#include "windows.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
TCHAR
command[MAX_PATH];
sprintf_s(command,"windows_study.exe");//保持本程序的exe文件名在command中
ZeroMemory( &si, sizeof(si) );
si.cb =
sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
if(!
CreateProcess(NULL,
command,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&si,
&pi))
{
cout<<"createprocess
failed"<<endl;
}
cout<<"aa"<<endl;
system("pause");
}
效果如图:
createprocess并行运算,布布扣,bubuko.com
时间: 2024-11-05 16:03:07