How could I detect when any application loses focus? Is there any system hooks to use? I want to pick up when ever a new application is in focus, or when one is lost. Even having the "current" HWND of the user would be good.
I am using C#, however, its all win api stuff I am sure... so any info would be great.