
- 加为好友
- 发送私信
- 在线聊天
|
| 发表于:2008-07-03 18:17:518楼 得分:10 |
STARTUPINFO si = {0}; si.cb = sizeof(si); si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_HIDE; PROCESS_INFORMATION pi = {0}; // Start the child process. if( !CreateProcess(NULL, szCmd.GetBuffer(), NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { TRACE(_T("Failed to execute Upgrade process(%d) \r\n%s!"), GetLastError(), szCmd); return -1; } WaitForSingleObject(pi.hProcess, INFINITE); DWORD dwCode = -1; GetExitCodeProcess(pi.hProcess, &dwCode); // Close process and thread handles. CloseHandle( pi.hThread ); CloseHandle( pi.hProcess ); if(m_WaitPackDlg.m_hWnd != NULL) m_WaitPackDlg.Exit(); return dwCode; | | |
修改
删除
举报
引用
回复
| |