On Windows 8.1 you go into the task manager and check the list of processes, there are two lists: - One for \"Apps\", which are visible foreground apps - One for \"Backgroun
Normally, if a process is an "App", it should have its own window's name, otherwise, it is a "Background application". Thus the code should be as follow:
Process[] arrProcess = Process.GetProcesses();
foreach (Process process in arrProcess)
{
if (!string.IsNullOrEmpty(process.MainWindowTitle))
{
//Do something with your App
}
else
{
//Do something with your Background process
}
}
The property System.Diagnostics.Process.MainWindowHandle is zero when process has not UI (i.e. is background process).
Services are also usually created by SYSTEM user - the column "User Name" in task manager.