How does task manager kill my program?

后端 未结 4 613
北恋
北恋 2021-01-18 00:22

I have this MFC program that when I kill it with task manager I get an exception on my program and then it crashes.

I want to get the event from the task manager, wh

4条回答
  •  -上瘾入骨i
    2021-01-18 01:09

    Yes, these are the options.

    For completeness, note that console mode applications get the CTRL_CLOSE_EVENT send that you could react upon, when the "End Task" button is clicked.

    Note that you cannot intercept or react upon TerminateProcess. Your process will die and there is nothing you can do before that happens. Actually, it would be pretty bad if you could. Because then there would be no way to terminate a process that went haywire.

提交回复
热议问题