0

我有主程序和系统窗口计算器。我想从主程序运行计算器,然后等待用户关闭它,然后放弃对主程序的控制。

我尝试这个解决方案:

auto child = boost::process::child("calc.exe");
child.wait();

auto child = boost::process::child("calc.exe");
while (child.running()) {}

并且在这两种方式中,计算器都会启动,但主进程不要等到孩子关闭并跑得更远。

我应该怎么做?

4

0 回答 0