I'm working on an implementation to force the exit of a process by PID in QT. The only way I found to solve this problem is using the following lines of code:
QString processToKill = "taskkill /F /PID " + QString(getAppPid());
system(processToKill.toStdString().c_str());
These lines do their job and works well, the only detail I have found is that when executing this command a console opens and closes quickly (a flicker). Is there any way to prevent this behavior?