The whole idea means you are doing something bad. No, I don't mean that you are writing malicious software. If this is
your application, you can always program it to terminate properly; and if your want to just kill it synchronously by some external process, this is extremely unsafe, bad for support, etc.
Anyway, you can handle the process creation events with WMI. Please see this CodeProject article:
Process Information and Notifications using WMI[
^].
Does it worth it? No, by the reasons I explained above. I don't think it even worth discussing. Again, it its your application, even it you want to cause its termination by external process, you can always program it to communicate with such process and synchronize the termination with its internal state. So, the communication means IPC, and the best way to organize such IPC would be some remoting, either "classical" .NET remoting or self-hosted WCF. As the problem is not tricky at all, it can be one or another.
Well, is it much better? Yes and no. At least doing so you would not commit a crime you are about to commit right now. But the whole idea of controlling the lifetime of one process by some other process… on the same machine… I have no idea of the architecture you keep in mind, but I would totally rethink it. Don't do evil.
More importantly, your approach to asking questions is also wrong. You just ask how to implement some technical effect, unreasonably assuming that what you want to do is right. You should start the question with explanation of your ultimate goal. Without it, going in further detail just would not make sense; the possible solutions would depend on those goals.
—SA