As shown in the picture below I would like to kill all those processes at once if I just press kill on the very top item. I would like to know how the task manager does it...Like how it finds the processes related and group them up like the picture those.
I have managed to kill the process by finding it by the names...but my application has a function of finding each other's processes and starts them if they are not started. I'm trying to kill both of them at once so none of the related application gets started again.
Sorry for the discomfort...I don't have enough reputation for a direct picture show.
Right now I have something like this but sometimes it kills two application fine but sometimes it keeps restarting...
string updaterProcess = "TimeKeeper.Updater";
Process currentProcess = Process.GetCurrentProcess();
currentProcess.Kill();
foreach (Process process in Process.GetProcesses())
{
if (process.ProcessName.ToLower() == updaterProcess.ToLower())
{
process.Kill();
currentProcess.Kill();
process.Kill();
currentProcess.Kill();
process.Kill();
currentProcess.Kill();
}
}