This code not work whene process have panic or was killed:
TBool IsProcessRunning(void) { TBool Ret(EFalse); TFileName res; TFindProcess find; while(find.Next(res) == KErrNone) { RProcess ph; ph.Open(res); #ifdef __SERIES60_3X__ if(ph.SecureId() == 0x12345678)// SID of the process we are looking for #else if(ph.FileName().Find(KtxApplicationFileName) != KErrNotFound) #endif { Ret = ETrue; break; } ph.Close(); } return Ret; }
So I use antoher if
... if(ph.SecureId() == 0x12345678)// SID of the process we are looking for ... if (ph.ExitType() == EExitPending) { Ret = ETrue; break; } ...