How to detect process killed from TaskManager

MFC app. How to detect if the process is being killed from taskmanager by clicking on "End process" button. The app needs to clean up and exit gracefully.
amesAsked:
Who is Participating?
 
arunprakashConnect With a Mentor Commented:
hi,
yes u can U can do it .
Override WM_QUERYENDSESSION when the application terminates u will get this message. Im 300% sure about it,

bye,
Arun
0
 
jkrCommented:
No chance... taskmgr.exe kills a process using 'TerminateProcess()', thus there is no possibility to intercept this...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.