I am working on a simple UI for the ccminer. As part of my launch/shutdown I use something like this to launch the ccminer.exe:
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = “ccminer.exe”
info.Arguments = "start";
info.UseShellExecute = false;
info.CreateNoWindow = true;
Process.Start(info);
When I need to stop it I just call kill(). Now, the problem is that this way, half of the time the console app crashes my video driver and does not gracefully shutdown.
If I were to run ccminer as a console app, I would hit CTRL+C and then it would ask something like: “Terminate, Y/N?” and upon receiving a confirmation - gracefully halt without crashing the video driver.
Is there a way I can programmatically mimic this graceful CTRL+C shutdown without simply killing my process?