0

Hi,

When I click the X button of the window, the FormClosing is working as a charm, BUT when I kill the application, or restart the computer the application also closes but the FormClosing does not work.

Why? and what should I do to execute a piece of code on this situation ?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by tanha
1

when you use taskmanager to "kill" the appliction, it doesn't fire any events, It simply stops the execution, This is how you close an application that has frozen. if you waited for it to handle any events, then it would still be frozen.

as for when you restart the computer or shutdown, the event will be called only if there is enough time, they system tells all applications it is shutting down and only gives them a short amount of time to handle business before it kills them. Windows 7 will show a dialog telling you which applications are still busy and ask you if you want to kill them and shutdown, or cancel. But as for XP, it just kills them after X amount of seconds.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.