As most of people have tried to migrate and test Windows 8, you must have notice that you can't kill background threads easily.

While searching for a solution to kill those, I have found that applications running in metro style application has a name Original Filename containing an mui extension.
In this post, you'll find a very basic console application that will allow you to kill these applications.

 

static void Kill()
{
    Console.WriteLine("Starting killing apps...");
    List<Process> processes = Process.GetProcesses().ToList();
    foreach (var process in processes)
    {
        try
        {
            if (process.MainModule.FileVersionInfo.OriginalFilename.Contains("mui"))
            {
                Console.WriteLine(String.Format("Killing process : {0}",process.MainModule.FileVersionInfo.InternalName));
                process.Kill();
            }
        }
        catch (Exception)
        {
 
        }
    }
}

This function is going to get all the processes running and will check whether its OriginalFilename contains the mui extension (the check can be improved).

To test this, we will just create a very simple Main function:

static void Main(string[] args)
{
    while (true)
    {
        string input = Console.ReadLine();
 
        switch (input)
        {
            case "kill":
                Kill();
                break;
            case "exit":
                Environment.Exit(0);
                break;
            default:
                Console.WriteLine("Command does not exist");
                break;
        }
    }
}

You'll need to make your application compile for your platform in the Configuration Manager.
For example, for x64, select Platform, New, Select x64 and use it to compile.

Now we can test this:

Let's launch the Weather Application, you can find it in TaskManager:

Launch the application we just created and the process will be killed using the command kill in the console application. You retrieve this information by counting the number of processes running (Process.GetProcesses().Count())

The application is left in the Windows + Tab bar but you'll see that it has been initialized.

Download the project (Visual Studio 2010)

x86

x64

Hope this will help and will stay a temporary solution :)

Linvi