CreateProcess示例
来源:互联网 发布:java如何转换日期格式 编辑:程序博客网 时间:2024/04/30 09:57
// Start the child process STARTUPINFO si;PROCESS_INFORMATION pi;ZeroMemory(&si, sizeof(si));si.cb = sizeof(si);ZeroMemory(&pi, sizeof(pi));TCHAR szCommandLine[] = TEXT("notepad.exe");if(!CreateProcess(NULL, // No module name (use command line) szCommandLine, // Command line 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) { AfxMessageBoxFormatted(TEXT("Create process failed: %d"), GetLastError()); return;}// Wait until child process exitsDWORD dwResult = WaitForSingleObject(pi.hProcess, INFINITE);switch (dwResult){case WAIT_FAILED: AfxMessageBoxFormatted(TEXT("Bad call to function WaitForSingleObject, maybe for invalid handle.")); break;case WAIT_OBJECT_0: AfxMessageBoxFormatted(TEXT("Child process exits.")); break;default: break;}// Close process and thread handlesCloseHandle(pi.hProcess);CloseHandle(pi.hThread);
0 0
- CreateProcess示例
- CreateProcess启动进程示例
- CreateProcess函数详解及示例
- CreateProcess函数详解及示例
- CreateProcess函数详解及示例
- CreateProcess
- CreateProcess
- createprocess
- CreateProcess
- CreateProcess
- CreateProcess
- CreateProcess
- CreateProcess
- createprocess
- createprocess
- CreateProcess
- CreateProcess
- CreateProcess
- 103:Binary Tree Zigzag Level Order Traversal【树】【BFS】【栈】
- 第六周上机实践项目3-人数不定的工资类
- kkkkkkkk
- Android---11---TextView显示图片信息
- Android 开源框架Universal-Image-Loader完全解析(一)--- 基本介绍及使用
- CreateProcess示例
- Mahout分布式程序开发 基于物品的协同过滤ItemCF
- codeforces 55D Beautiful numbers[数位dp]
- C++LNK错误总结(摘抄别人的),留着自已用,哈哈。。。
- JAVA第三次实验
- 第六周上机实践项目4-成员函数、友元函数和一般函数有区别
- tomcat jdk内存配置
- UVA 1344 - Tian Ji -- The Horse Racing(很好的贪心题)
- 用PriorityBlockingQueue简化线程优先级调度策略