标签:控制台返回值
在控制台程序的函数中使用ExitProcess函数,退出函数,调用者接收返回值:DWORD nResult; SHELLEXECUTEINFO ShExeInfo = { 0 }; ShExeInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExeInfo.fMask = SEE_MASK_NOCLOSEPROCESS; ShExeInfo.hwnd = NULL; ShExeInfo.lpVerb = NULL; ShExeInfo.lpFile = _T("a.exe"); ShExeInfo.lpParameters = _T(" 1"); ShExeInfo.lpDirectory = NULL; ShExeInfo.nShow = SW_HIDE; ShExeInfo.hInstApp = NULL; ShellExecuteEx(&ShExeInfo); WaitForSingleObject(ShExeInfo.hProcess, 1000 * 120); GetExitCodeProcess(ShExeInfo.hProcess, &nResult);
标签:控制台返回值
原文地址:http://blog.51cto.com/9233403/2110636