I have a Windows service(C#), that sprawns few child native processes (C++).
I'd like to gently kill those processes once in a while. (gently = let the procs to finalize its work before going down).
I tried to use the SetConsoleCtrlHandler() routine to register the child procs to console events and to call the CloseMainWindow() from the C# code to raise the "close console" events.
This didn't work for me. Mainly because the child processes are not console applications.
Does anyone knows what other methods can be used in order to fulfill this requirement?