Symbian 杀死进程的实现 Kill process for symbian
2010-04-20 16:09:00 来源:WEB开发网核心提示:Kill process for symbian//Kill process for symbianvoid KillProcess(const TDesC& aProcessNameNotExtName){ //根据程序名,在系统中杀掉一个进程 KillProcess(_L(“HelloWorld”));TFullN
Kill process for symbian
//Kill process for symbian
void KillProcess(const TDesC& aProcessNameNotExtName)
{ //根据程序名,在系统中杀掉一个进程 KillProcess(_L(“HelloWorld”));
TFullName name;
TFindProcess finder;
while(finder.Next(name) == KErrNone)
{
console->Printf(_L(“%S ”),&name);
// console->Getch();
// check if this is our process
if(name.FindF(aProcessNameNotExtName) != KErrNotFound)
{
RProcess process;
if(process.Open(finder, EOwnerProcess) == KErrNone) // Open process
{
process.Kill(KErrNone); // Kill process
process.Close();
}
}
}
}
更多精彩
赞助商链接