int thisProcessCount(const char *arg)
{
QProcess process;
process.start("cmd", QStringList() << "/C" << "echo" << "process" << "get" << "caption" << "|" << "wmic");
process.waitForStarted(2000);
process.waitForFinished(2000);
bool result = process.readAll().count(QFileInfo(QString(arg).section('\\',-1)).fileName().toAscii());
if(QFile::exists("TempWmicBatchFile.bat"))
QFile::remove("TempWmicBatchFile.bat");
return result;
}
не-быдло решение: QtSingleApplication