Trying to 'gracefully' exit XBMC from an external .NET winforms app. I find it then try to close it using Process.Close() or Process.CloseMainWindow() (http://msdn.microsoft.com/en-us/library/ccf1tfx0.aspx), but it responds to neither. Only one that works is Process.Kill(). Close() \ CloseMainWindow() work with other things though, like Notepad.
Thoughts?
FindAndKillProcess("XBMC");
public bool FindAndKillProcess(string name)
{
foreach (Process clsProcess in Process.GetProcesses())
{
if (clsProcess.ProcessName.StartsWith(name))
{
//clsProcess.Close();
//clsProcess.CloseMainWindow();
clsProcess.Kill();
return true;
}
}
return false;
}
Thoughts?
FindAndKillProcess("XBMC");
public bool FindAndKillProcess(string name)
{
foreach (Process clsProcess in Process.GetProcesses())
{
if (clsProcess.ProcessName.StartsWith(name))
{
//clsProcess.Close();
//clsProcess.CloseMainWindow();
clsProcess.Kill();
return true;
}
}
return false;
}