473,480 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Process kill event

Hi,
I am looking for an event thet raises when the proccess is killed (for ex: Shotdown from the TaskManeger)

I have allready tried:
Form.Close
Form.Dispose
Application.Exit
Process.Exited
Finalize

I wrote a little program to chack it, Please add the event to the program of explane how to do it
RAR: http://uploaded.fresh.co.il/2004/08/09/960473.rar
ZIP: http://uploaded.fresh.co.il/2004/08/09/155273.zip

10x a lot, Gil
--------------------------------
From: gil sh

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Wf8yqTR7Kk+ApddOymol9A==</Id>
Nov 22 '05 #1
2 2900
Gil,

To my knowledge, there is no such event. The primary thread on which the
process is running is terminated by the operating system -- therefore, there
is no process left for any of the events you listed to fire on.

Now, the "End Process" button on the task manager is different from the "End
Task" button or what happens when you click "Shut Down". End Task and Shut
Down send a more friendly shut down message to the application, and you will
find that the standard events work just fine.

What is your purpose in interrupting the process kill? Depending on the
environment, you may be able to detect when the process has been terminated
by watching it with another process.

-Michael

"gil sh via .NET 247" wrote:
Hi,
I am looking for an event thet raises when the proccess is killed (for ex: Shotdown from the TaskManeger)

I have allready tried:
Form.Close
Form.Dispose
Application.Exit
Process.Exited
Finalize

I wrote a little program to chack it, Please add the event to the program of explane how to do it
RAR: http://uploaded.fresh.co.il/2004/08/09/960473.rar
ZIP: http://uploaded.fresh.co.il/2004/08/09/155273.zip

10x a lot, Gil
--------------------------------
From: gil sh

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Wf8yqTR7Kk+ApddOymol9A==</Id>

Nov 22 '05 #2
> I am looking for an event thet raises when the proccess is killed (for ex: Shotdown from the TaskManeger)

A windows application is terminated by receiving any of the WM_CLOSE,
WM_DESTROY or WM_QUIT messages from the operating system. If none of
these messages are received then your application has nothing to trap
and know that it gets killed. If think TaskManager simply uses
TerminateProcess without any other messages, meaning that you cannot
trap this event.

Are you needing an application that is always alive? Maybe something
along the lines of a system service is more what you need??

Simon Hayden
http://www.AutoUpdatePlus.com
Get software updates to your clients the Quick and Easy way!
Latest Version ==========>>> Client Computer
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
458
by: gil sh via .NET 247 | last post by:
Hi, I am looking for an event thet raises when the proccess is killed (for ex: Shotdown from the TaskManeger) I have allready tried: Form.Close Form.Dispose Application.Exit Process.Exited...
3
1946
by: Wilfried Mestdagh | last post by:
Hi, I use C# 2005 beta with NET 2005 beta. How to kill a process ? Is this possible in this version ? I foundsom things in help but it is not clear to me, if someone can give me brief example it...
0
959
by: Sam Marrocco | last post by:
I seem to be having a devil of a time killing a process.... If I launch an applicaton such as notepad.exe as a Process, I can kill it with no problem. However, if I launch a particulare...
4
15868
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager,...
10
2163
by: Susan | last post by:
I have a process that takes a while to run so I have it running asynchronously so that the user can continue working. My question is that I want to killl the process if the user changes the search...
9
16033
by: SeC | last post by:
Hi. Is there any way to detect if application is being killed by 'End Process' via Task Manager ?
4
20755
by: Richard Rossel | last post by:
Hi Fellows, I have a problem with process termination. I have a python code that apache runs through a django interface. The code is very simple, first, it creates a process with the...
5
1791
by: ags5406 | last post by:
I've a Windows Service that keeps a particular executable running. If the executable fails for whatever reason, the Service restarts it. Right now I'm using a loop to check if the process is...
2
3909
by: news.microsoft.com | last post by:
How can a VB program detect a kill process which was used to close it down. I have a routine that detects when a user exits the program and I can track the session times. But how can I detect when...
0
2156
by: eddy82 | last post by:
Hi guys.I need some advice as i my db2 instance was kill off suddenly at late night and not sure what has kill it. 2008-10-14-22.47.53.326765+480 E31715373A878 LEVEL: Severe PID : 856268...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7043
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7081
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6737
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6921
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5336
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.