19 October 2005

How to kill another process by its name

This code snippet will kill process with name KPROCNAME

TFullName theName;
TFindProcess process;
while ( process.Next( theName ) != KErrNotFound )
{
if ( ( theName.Find( KPROCNAME ) != KErrNotFound ) )
{
RProcess aProcess;
aProcess.Open( process );
aProcess.Kill(0);
aProcess.Close();
}
}

No comments: