创建进程和退出进程
2011-04-23 17:00
190 查看
bool CCreateProcessDlg::ProcessExec(LPCTSTR fileName) { if(!CreateProcess(fileName,NULL,NULL,NULL,NULL,CREATE_NEW_CONSOLE,NULL,NULL,NULL,&processInfo)) { return FALSE; } //CloseHandle(processInfo.hThread); //CloseHandle(processInfo.hProcess); return TRUE; } void CCreateProcessDlg::OnBnClickedButtonExec() { // TODO: Add your control notification handler code here ProcessExec(_T("iesample")); } void CCreateProcessDlg::OnBnClickedButtonExit() { // TODO: Add your control notification handler code here DWORD exitCode; //ExitProcess(exitCode); if(TerminateProcess(processInfo.hProcess,exitCode)) { MessageBox(_T("exit iesample.exe success")); if(ExitProcess(exitCode)) { MessageBox(_T("exit CreateProcess.exe success")); } else { MessageBox(_T("exit CreateProcess.exe success")); } } else { MessageBox(_T("exit iesample.exe fail")); } }
相关文章推荐
- Linux0.11笔记——进程从创建到退出全过程的一个实例
- mfc多线程创建,对话框关闭前退出进程
- 进程的创建以及退出
- VC++ 创建进程并等待其退出
- linux 进程的创建 和退出回收
- vb6创建子进程并等待子进程的退出。
- linux创建进程和等待进程退出
- linux创建进程和等待进程退出
- 主进程中如何退出pthread_create创建的线程?
- 创建守护进程:先建立守护进程,在守护进程建立一个子进程,该子进程暂停10s,然后退出,并由该守护进程收集子进程退出的消息。子进程,守护进程的退出消息都在/var/log/message中输出,子进程退
- 进程的创建以及退出
- 进程切换、创建与退出流程详解
- 进程创建与退出小谈
- 进程的创建,等待,退出,
- 进程的创建、运行、退出
- Linux下创建两个子进程,并在子进程异常退出时重新创建
- 进程切换,创建,加载,等待与退出
- 创建进程和退出进程
- PB用OLE创建Excel后,退出程序后excel.exe进程还在
- 创建进程并等待其退出