I have an application "X" which communicates with another application "Y". I want to have my application X check when there is no more communication with application Y and if so kill itself and Y. Application X has GUI written in C# which runs C++ code. Application Y is written in C++. How can I do this? Thanks in advance
Asked
Active
Viewed 90 times
0
-
Similiar question that maybe help you http://stackoverflow.com/questions/3342941/kill-child-process-when-parent-process-is-killed – Oleg Jun 08 '15 at 10:28
1 Answers
1
In your C# app you can call Process.Kill() method on 'Y' app and itself if you lost connectivity
Process [] proc Process.GetProcessesByName("your_process");
proc[0].Kill();

Enrich Silen
- 23
- 1
- 6
-
I think the OP is asking on how to **know when to kill** the child app, not on **how to kill** an app. – Kryptos Jun 08 '15 at 10:45
-
I am asking both. How to do it and how to know when. Thanks Enrich for the first answer. can anyone answer the second part of the question (how to know when?) Please note that application X and Y are not related. None is child of the other... – user3683638 Jun 08 '15 at 10:51