Running a Windows program and detect when it ends with C++

前端 未结 7 1633
清酒与你
清酒与你 2020-12-05 21:48

Suppose I run an application, after some time this app will get closed by user. Is it possible to find out when the program exits? Can I get it\'s process id when I run that

相关标签:
7条回答
  • 2020-12-05 22:38

    An alternative approach which offers even more control is to use the Win32 Job API, see CreateJobObject() and AssignProcessToJobObject(). This would allow you to monitor your spawned process asynchronously using an IO Completion Port using SetInformationJobObject() it's more complex and probably more than you need but it does give you much more control over the spawned processes.

    0 讨论(0)
提交回复
热议问题