I am working on development of a plugin writing in c# winforms for an application. I have set up a start action in debug. I have set start external program and it is starting that application. In my winforms I have written code for a button click event which starts a new process say notepad.exe
Now the question is whenever I close that external application all the opened notepad which are invoked from this button click event should be closed automatically.
Any help can be appreciated.
You can use System.Diagnostics.Process to start process, like this:
And in Closing event you can use:
Also you can store just an id of your processes: