bool applicationIsRunning(){ bool ret = false; QString name( "first.exe" ); HANDLE hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if ( hProcessSnap == INVALID_HANDLE_VALUE ) return false; PROCESSENTRY32 pe32 = { 0 }; pe32.dwSize = sizeof(PROCESSENTRY32); if ( ::Process32First( hProcessSnap, &pe32 ) ) { do { if ( QString( pe32.szExeFile ).upper() == name.upper() ) { ret = true; break; } } while (::Process32Next( hProcessSnap, &pe32 ) ); } ::CloseHandle( hProcessSnap ); return ret; }