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

前端 未结 7 1659
清酒与你
清酒与你 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:14

    In a quick search at google I found these two methods from msdn which can be useful:

    CreateProcess and GetExitCodeProcess. This assuming you are creating a process within your application.

    You can do a polling method checking the created process status. I never did this kind of thing, but seems a very strange approach to me.

提交回复
热议问题