STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = TRUE; //TRUE表示显示创建的进程的窗口 TCHAR cmdline[] =TEXT("c://program files//internet explorer//iexplore.exe "); BOOL bRet = ::CreateProcess ( NULL, cmdline, //在Unicode版本中此参数不能为常量字符串,因为此参数会被修改 NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);int error = GetLastError();
if(bRet) { ::CloseHandle (pi.hThread); ::CloseHandle (pi.hProcess);}