Note: There\'s a very similar question, but it\'s WPF-specific; this one is not.
How can I determine if the current application is activ
In WPF the easiest way to check if a window is active is:
if(this.IsActive) { //the window is active }