title: Determine if current application is activated (has focus)
body: <blockquote>
    <p>Note: There's a <a href="https://stackoverflow.com/q/7049989/21475">very similar question</a>, but it's WPF-specific; this one is not.</p>
  </blockquote>
  
  <p>How can I determine if the current application is activated (i.e. has focus)?</p>