How to safely close external program like "VLC" from QT
-
i need to close external application currently running on my system from QT. (Like "VLC", "Virtual DJ") etc. [work on Windows and Linux both ]
I searched and finally found Qprocess. I am searching for an example or tutorial to show me how to close external programs, but I am unable to find any solution. I am a newbie , so can anyone help me Please or show me a demo?
Thanks.
-
Hi,
Are you starting these application from your own application ? If so how are you doing it ?
Out of curiosity, why do you need such a feature ?
-
Hello @SGaist
I have resolved this issue. But, It's good to see that there is someone who is always ready to help everyone. Thanks for your suggestions and support. :)
Now, Actually In my application, I can close any running external program selected from a drop down list .
For this I have created a method to get PID (Work for both windows and linux)
QString My::getProcessIdsByProcessName(const char* processName, QStringList &Pids)
{//code
}and after getting PID's, I call appropriate function to close a particular application.
Thanks!
-
One thing to add to @kshegunov, terminating these applications ungracefully may have side effects on the stability of your system.