What killed my process and why?
If the user or sysadmin did not kill the program the kernel may have. The kernel would only kill a process under exceptional circumstances such as extreme resource starvation (think mem+swap exhaustion).
How to find out who killed the process?
You can not prevent your process from being killed (see this question and this article) and there is no way to know who killed the process.
Kill my process if the other process is killed
SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = exeFile.c_str();
ShExecInfo.lpParameters = "";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
ShowWindow(SW_HIDE);
WaitForSingleObject(ShExecInfo.hProcess, INFINITE);
EndDialog(0);
Related Topics
Bluetooth Low Energy: Listening For Notifications/Indications in Linux
Automating Running Command on Linux from Windows Using Putty
Setting the Umask of the Apache User
How to Loop Over the Output of a Shell Command
Can Awk Patterns Match Multiple Lines
How to Create Docker Overlay Network Between Multi Hosts
Why Is a Tilde in a Path Not Expanded in a Shell Script
Separately Redirecting and Recombining Stderr/Stdout Without Losing Ordering
Git Asks For Username Every Time I Push
Shell Command to Tar Directory Excluding Certain Files/Folders
How to Kill All Processes With a Given Partial Name
How to Replace a String in Multiple Files in Linux Command Line
How to Use Grep to Show Just Filenames on Linux
How to Obtain the Number of Cpus/Cores in Linux from the Command Line