Link to home
Start Free TrialLog in
Avatar of viraj_1980
viraj_1980

asked on

abnormal program termination

how do i detect when user kills the application using end process tab in task manager.WM_CLOSE is received on end task exit but not on end process.I tried using wm_queryendsession and terminateprocess but neither seems to be working.
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

What about a message hook, that looks for a WM_ENDSESSION, WM_QUERYENDSESSION

Rosh :)
Avatar of jhance
jhance

You cannot.  When the Task Manager does its thing it is using the Windows API TerminateProcess().  There is NO recovery or other response possible in the process being terminated.  I.e. it's an unconditional termination.
ASKER CERTIFIED SOLUTION
Avatar of vijay_visana
vijay_visana

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial