PROCESS_INFORMATION proc;
STARTUPINFO start;
int ReturnValue;
memset(&start,0,sizeof(start));
start.cb = sizeof(start);
char strName[] = "myPro.exe"; //所要执行外部程序的路径及文件名
char cwd[MAX_PATH];
GetCurrentDirectory(sizeof(cwd),cwd);
ReturnValue = CreateProcess(NULL,strName,NULL,NULL,TRUE,CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS,NULL,cwd,&start,&proc);
CloseHandle(proc.hThread);
WaitForSingleObject(proc.hProcess,INFINITE);
CloseHandle(proc.hProcess);
STARTUPINFO start;
int ReturnValue;
memset(&start,0,sizeof(start));
start.cb = sizeof(start);
char strName[] = "myPro.exe"; //所要执行外部程序的路径及文件名
char cwd[MAX_PATH];
GetCurrentDirectory(sizeof(cwd),cwd);
ReturnValue = CreateProcess(NULL,strName,NULL,NULL,TRUE,CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS,NULL,cwd,&start,&proc);
CloseHandle(proc.hThread);
WaitForSingleObject(proc.hProcess,INFINITE);
CloseHandle(proc.hProcess);