Recognize Application Termination

  • Thread starter Thread starter Jörg Krause
  • Start date Start date
J

Jörg Krause

Hi all,

I've a winforms application running on Windows 98/Me. How
can I recognize the termination of the application if the
user kills the process in the task manager?

Microsoft.Win32 provides SystemEvents.SessionEnd, but this
is still not fired if the process goes down, only if windows
is closed or the user ends his session the normal way.

The form closing/closed events do not fire if the process
is killed. But it is necessary to clean up some connections.

I'm using C#/Framework 1.1. It is not possible to switch to
XP/2000 where I can use services or protect the tasks using
security levels.

Or, on the other hand, is there any way to protect a software
from beeing killed in task manager on Win9x/Me systems and
how to do this using .NET apps?

Thanks for any ideas,

Joerg
 
Hello Joerg,

Thanks for your post. As I understand, you want to prevent your .NET
application from beeing killed in task manager on Win9x/ME. Please correct
me if there is any misunderstanding.

As you know, task manager will unconditionally cause a process to exit.
Based on my experience and research, we are not able to get notified and
prevent it from beeing killed on Win9x/ME.

Please feel free to let me know if you have any problems or concerns.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
As I understand, you want to prevent your .NET
application from beeing killed in task manager on
Win9x/ME. Please correct
me if there is any misunderstanding.

Yes, this is exactly what I want.

I now that task manager will unconditionally cause a process to exit. I
don't want to interrupt that. I want to be informed about the process. I
would be nice if my application can receive an event (IsKilling) and the
user see the well know window "Abort now | Cancel" and in the meanwhile
I can save some unsaved data or something like that.

My experience is that the termination of an app can be delayed if the
app does not respond to the term (or kill) signal. Can I simulate that
by suppress the correct answer from within a .NET app (short: simulate
that the app hangs)? If the user forces the app to be killed I can
accept this, I need just a few microseconds to do my stuff...

-Joerg
www.joerg.krause.net
ASP.NET/.NET-WinForm Softwaredevelopment
 
Hello Joerg,

Task Manager just kill a process without notifying it. As you know, Task
Manager need to even kill a process which hangs somehow. I believe that
there is no method to work around this problem on Windows 9x. Sorry about
that.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top