bool checkProcessRunning(const QString &processName, QList<quint64> &listProcessId) { #ifdef Q_OS_WIN bool res = false; HANDLE hToolHelp32Snapshot; hToolHelp32Snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); PROCESSENTRY32 pe = { sizeof(PROCESSENTRY32) }; BOOL isSuccess = Process32First(hToolHelp32Snapshot, &pe); while (isSuccess) { size_t len = WideCharToMultiByte(CP_ACP, 0, pe.szExeFile, wcslen(pe.szExeFile), NULL, 0, NULL, NULL); char *des = (char *)malloc(sizeof(char) * (len + 1)); WideCharToMultiByte(CP_ACP, 0, pe.szExeFile, wcslen(pe.szExeFile), des, len, NULL, NULL); des[len] = '