PDA

View Full Version : Multiplateform "is a program running"



bunjee
1st July 2009, 17:44
Hey guys,

Has anyone coded a function to know if a given binary is currently running or not ?

e.g:


if (isRunning("myExe.exe") == false)
{
// ...
}

Thanks.

wysota
1st July 2009, 18:02
You can use shared memory (QSharedMemory) or a system semaphore (QSystemSemaphore) for that. If you're interested in assuring that there is only one instance of the application running, search for QtSingleApplication or look into our wiki.