MFC用CreateProcess启用新的进程

void CreatePro()
{
STARTUPINFO sInfo;
PROCESS_INFORMATION pInfo;


memset( &sInfo, 0, sizeof( STARTUPINFO ) );
memset( &pInfo, 0, sizeof(PROCESS_INFORMATION ) );


sInfo.cb = sizeof( STARTUPINFO );
sInfo.dwFlags = STARTF_USESHOWWINDOW;
sInfo.wShowWindow = SW_SHOW;


CreateProcess( "C:\\Documents and Settings\\PK\\桌面\\eDogTools\\Debug\\main.exe", /* 待运行的程序 */

  " sz2_idtype.txt RTA(0511-0514).csv", /* 传递给待运行程序的参数 */

  NULL,
  NULL,
  FALSE,
  0,
  NULL,
  NULL,
  &sInfo,
  &pInfo
);


CloseHandle(pInfo.hProcess);
CloseHandle(pInfo.hThread);

}

注:头文件为“windows.h”

你可能感兴趣的:(学习笔记)