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

C# Foreach loop through json-object, get key [duplicate]
Excel Connectionstring DriverId
BotConnector dynamic field not working: even when a user clicks on one of the buttons in the prompt, the Bot fails to recognize the response
WCF Collection returns empty
Extending interface with new model
How to programmatically get Azure Service Bus Relay details (C#)?
The type or namespace name 'ThreadPoolTimer' could not be found
Join IQueryable with List on object from list
Exporting gridview with paging
Is it possible to pin a text on the top of the console c# [duplicate]
How to read simultaneously by several COM ports
How to delete rows with same value in datagridview
How to passing value to textbox in second form when object has been lunched
Make my datepicker required and remove it after selecting a date in c#
Microsoft Graph. DriveItem Id format?
DateTime parsing - unexpected result

Categories

HOME
oop
msbuild
indexing
kendo-ui-angular2
wifi
mysqli
blob
ebay
ms-access-2010
markdown
pip
genexus
annyang
dcos
rename
olap
distinct
desktop-application
hdf5
lambda-calculus
exchange-transport-agents
openstack-horizon
appsettings
tag-cloud
game-engine
git-branch
android-navigation-drawer
multipart
beaker-notebook
uipath
chartist.js
sasl
android-6.0-marshmallow
formtastic
cloudformation
proof-general
sqldependency
meteor-accounts
restangular
intermec
boost-log
jcr
node-soap
android-scrollview
powerbi-embedded
android-geofence
rbac
susy
php-mongodb
cakephp-3.2
npoco
qtwebkit
hierarchical-clustering
yank
perldoc
trusted-computing
tsc
wicketstuff
hdr
boost-range
rowname
vga
patching
db2-zos
php-java-bridge
supervised-learning
video-embedding
trendline
google-finance-api
ios8-share-extension
redquerybuilder
identifying
bootstrap-tabs
winforms-interop
pymol
teamstudio-unplugged
caption
cordova-3
azure-worker-roles
triplestore
webshim
image-preloader
kernel-density
nvcc
mdp
ekevent
jfilechooser
google-mirror-api
mencoder
static-class
architectural-patterns
system.transactions
cron4j
junit-rule
doxia
winrt-async
datasheet
ruby-1.9
copyfile
code-organization
yii-cactiverecord
cgaffinetransform
log-shipping
digg
jexcelapi
xhtmlrenderer
marathontesting
excellibrary
conditional-operator
datarelation
datadude

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