I'm trying to emulate a program I once used which is called it ZapIt! for pocket pc,the idea is simple, kill a process or close Main Window that the focus is on or is in the foreground, Using C# ofcourse.In Windows, I can kill or close a process by Name or PID, but how can I close a process that thefocus is on or is in the foreground. I want to obtain the process object so I can apply my manipulations.Notice i'm dealing with pocket pc here so any program in front is a foreground process, Zapit worksfrom the start menu so when you click it, it closes ,(not send it to the background),the app that was in the foreground.