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

Invoke a non generic method with generic arguments defined in a generic class
Display ticket remaining time
Can't call Click Event on dynamic button
OdbcConnection.GetSchema(“TABLES”); not working
How to filter data in RDLC report?
defining characters to ignore while matching strings C# [closed]
How do I get the network interface and its right IPv4 address?
How can I delete a directory in a Zip file using .NET?
receiving string from c# to Java mistakes
No endpoint listening wcf/rest
How to add NT AUTHORITY\IUSR to Administrators group
Combobox in Syncfusion XlsIO
Creating a Strong Name dynamically, without Sn.exe
Why is my locally declared variable not being recognized in the finally block?
Comparing two different types with Entity Framework
loginview shows “welcome system-name/administrator” and logout for the first time page load

Categories

HOME
ssms
redux
netty
salesforce
pelican
artifactory
msbi
servicenow
revit-api
cracking
email-attachments
desktop-application
captcha
expo
derby
minimum
web-worker
greensock
multibinding
infinite-loop
ithit-webdav-server
jira-zephyr
sasl
akavache
stack-trace
setup-project
dynamics-ax-2012-r3
vtd-xml
foxpro
urhosharp
certbot
motion
origami
nscollectionview
mockserver
latency
blueimp
aura-framework
amazon-rds-aurora
f#-fake
inner-join
google-cloud-shell
runtime-permissions
playframework-1.x
seyren
senti-wordnet
critical-section
scrollmagic
turbolinks
racket-student-languages
symantec
sprockets
vitamio
django-celery
aws-kms
phpdesigner
custom-build-step
video-embedding
music-player
std
fadein
sqldataadapter
markerspiderfier
encode
newlib
ios8-share-extension
maven-antrun-plugin
jts
musicbrainz
vanilla-forums
tooltwist
strcpy
connection-timeout
applinks
im4java
hotlinking
satisfiability
complete
friendly-id
scidb
ie-developer-tools
infomaker
caroufredsel
nokogiri
azure-pack
android-library
backbone-views
pudb
magicsuggest
generator-expression
metapost
cron4j
tasklist
inflate
jquery-1.8
idtabs
isgl3d
symfony-1.2
chromebug
zend-acl
weak-typing
scalable

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