如何等待一个进程完成C ++ [英] How to wait for a process to finish C++
本文介绍了如何等待一个进程完成C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我用这个代码创建一个进程:
I am creating a process with that code:
CreateProcess(NULL, "process.exe", NULL, NULL, TRUE, 0, NULL, NULL, %ini_processo, %processo_info);
我需要我的代码来等待我的进程完成,然后恢复。什么是C ++的方法?
I need my code to wait for my process to finish before resuming. What is the method with C++ ?
推荐答案
您只需调用 WaitForSingleObject
href =https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx =nofollow> CreateProcess
返回。
You just call WaitForSingleObject
on the handle CreateProcess
returns.
这篇关于如何等待一个进程完成C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文