代碼如下:
void Enter()
{
STARTUPINFO info;
PROCESS_INFORMATION procInfo;
memset (&info, 0, sizeof (STARTUPINFO));
info.cb = sizeof (STARTUPINFO);
info.lpDesktop = NULL;
info.lpTitle = NULL;
info.dwFlags = 0;
if (CreateProcess (NULL, _T("你要的執行檔.exe"), NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &info, &procInfo))
{
CloseHandle (procInfo.hProcess);
CloseHandle (procInfo.hThread);
}
}