PC Review


Reply
Thread Tools Rate Thread

How do a trap a process kill attempt?

 
 
Peter Steele
Guest
Posts: n/a
 
      23rd Mar 2005
I want to trap any attempts to kill my C# application and so that I can
execute shutdown code and let the app die gracefully. How can this be done?


 
Reply With Quote
 
 
 
 
John Sun
Guest
Posts: n/a
 
      23rd Mar 2005
Peter Steele wrote:
> I want to trap any attempts to kill my C# application and so that I can
> execute shutdown code and let the app die gracefully. How can this be done?
>
>

I think you worry too much, as long as you do the normal cleanup at the
program exit, it should be fine.

Just imagine how could you trap when people shut down the computer, or
power off :-)

John
 
Reply With Quote
 
Adam
Guest
Posts: n/a
 
      23rd Mar 2005
John Sun wrote:
> Peter Steele wrote:
>
>> I want to trap any attempts to kill my C# application and so that I
>> can execute shutdown code and let the app die gracefully. How can this
>> be done?
>>
>>

> I think you worry too much, as long as you do the normal cleanup at the
> program exit, it should be fine.
>
> Just imagine how could you trap when people shut down the computer, or
> power off :-)
>
> John

You should try brushing up on your event listeners
 
Reply With Quote
 
Peter Steele
Guest
Posts: n/a
 
      23rd Mar 2005
This is definitely not worrying too much. It is essential that this
application make every best effort to close down cleanly. If someone shuts
the power off, then clearly there's nothing that can be done...

"John Sun" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Peter Steele wrote:
>> I want to trap any attempts to kill my C# application and so that I can
>> execute shutdown code and let the app die gracefully. How can this be
>> done?
>>
>>

> I think you worry too much, as long as you do the normal cleanup at the
> program exit, it should be fine.
>
> Just imagine how could you trap when people shut down the computer, or
> power off :-)
>
> John



 
Reply With Quote
 
David Levine
Guest
Posts: n/a
 
      23rd Mar 2005
Subscribe to the AppDomain.CurrentDomain.ProcessExit event - this gets fired
when the application is terminating cleanly and while all system components,
appdomains, etc. are still functional.

"Peter Steele" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I want to trap any attempts to kill my C# application and so that I can
>execute shutdown code and let the app die gracefully. How can this be done?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
catch notifyicon kill attempt so dispose can run deciacco Microsoft C# .NET 2 19th Jul 2007 05:15 PM
Process.Kill:How to kill an attached debugger? Manfred Braun Microsoft C# .NET 1 16th Aug 2005 08:53 PM
how to kill a connection attempt =?Utf-8?B?YW5kcmVz?= Microsoft VB .NET 1 29th Jun 2005 03:31 PM
How to kill a child process when kill the parent process lynn Microsoft Dot NET 0 31st Jul 2003 04:12 PM
How to kill a child process when kill the parent process lynn Microsoft C# .NET 0 31st Jul 2003 04:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:36 PM.