Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have tried below code but i cant find if my app is terminated by taskmanager

C#
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
            messageBoxCS.AppendFormat("{0} = {1}", "CloseReason", e.CloseReason);
            messageBoxCS.AppendLine();
            messageBoxCS.AppendFormat("{0} = {1}", "Cancel", e.Cancel);
            messageBoxCS.AppendLine();
            MessageBox.Show(messageBoxCS.ToString(), "FormClosing Event");
Posted
Updated 10-Oct-12 5:34am
v2
Comments
Sergey Alexandrovich Kryukov 10-Oct-12 12:19pm    
Maybe, by "terminated" you mean something unusual? :-) Then it depends on definitions...
--SA

1 solution

When an application windows is about to be closed and even already closed, your application is not terminated yet, so it can perform some action. If it is terminated, it's too late. At this code, you don't any code running to detect the code is terminated. :-)

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900