c#


How to detect a Kill Process event


In C# i using process.Kill() kill a process,
at the same time in killed application how to detect this event?
BTW: Application.ApplicationExit event has not been fired!
if it's a winform, you can capture the event FormClosing and check the CloseReason:
None
WindowsShutDown
MdiFormClosing
UserClosing
TaskManagerClosing
FormOwnerClosing
ApplicationExitCall
There are no simple ways of accomplishing this, though code injecting, api hooking, and a number of other techniques could be used to accomplish this very goal, but my question to you is, do you really want to go through a lot of extra work just to make sure your application is aware of an unexpected termination? You would have to ensure that you code injected/hooked (or whatever method your chose) every single possible method someone else could use to terminate your application, when someone does make one of those calls your application can trigger its own event indicating that it should process such an event and prepare to exit. Essentially you could also use this to stop anyone else from being able to close your application as well.
If you want more information about any of these techniques let me know and I'll post some links. Good luck!

Related Links

How do I launch the VBA Editor?
How to escape [ in app.config file?
Explicit conversion from int -> sbyte -> sbyte?
IL: how to generate specific C# function?
Implementing 2 similar interfaces in C#
Programmatically add highlighting to shape (path)
read nodes from yaml file
Keep state of control after closing MDI child
Windows phone: Combine images and make a video file
How do I capture lost focus on a Textbox?
How to Read a text file after skipping specified number of lines in C#
Deleting all same values from Generic List
How do I create a workspace with local folder mappings in tfs using C#
2D array simple issue
How do I set my item[“Explanatory Text”] equal to public class ExpandedHomeSlider string ExplanatoryText and then add it to my expandedSliderList?
Index out of bounds in c# while using this code

Categories

HOME
repository
stata
packet
stdout
crash
ms-application-insights
swap
liquidsoap
open-search-server
qt4
normals
spring-data-solr
oxid
repeater
eclipse-orion
react-select
versioning
google-street-view
openoffice-basic
custom-component
klipfolio
connection-pooling
ithit-webdav-server
ballerinalang
adobe-captivate
smart-device
cloudformation
mex
hierarchical-data
setup-project
request-uri
xlib
textview
mplab
unity3d-5
intersection
cocoa-scripting
ragel
nsdateformatter
pyexcel
colorbox
scrollmagic
catalyst
blackberry-webworks
firebase-polymer
networkstream
recurring
git-cherry-pick
system-integration
custom-build-step
nslocalizedstring
wonderware
ewam
encode
gtkwave
recode
transport
azure-mobile-app
borland-c++
eula
cakephp-2.6
jeet-grid
gmaps4jsf
jad
xmla
jsonschema2pojo
illegalargumentexception
novell
growl
cocos2d-x-2.x
redmine-plugins
pnunit
agent-based-modeling
indic
serializer
disabled-control
scjp
banana-pi
android-relativelayout
dayofweek
nvcc
nomachine
mdp
pechkin
cab
phone-state-listener
microsoft-speech-platform
idoc
helicontech
funambol
method-call
xhtmlrenderer
xcdatamodel
mediastreamsource
oaw
iphone-maps
large-data-volumes
data-formats
time-management
bootstrap-protocol
cstring
vista64
software-update

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App