title: Global hotkeys in WPF working from every window
body: <p>I have to use hotkeys which will be working from every window and pulpit. In winforms I used:</p>
  
  <pre><code>RegisterHotKey(this.Handle, 9000, 0x0002, (int)Keys.F10);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>UnregisterHotKey(this.Handle, 9000);
  </code></pre>
  
  <p>and </p>
  
  <pre><code>protected override void WndProc(ref Message m)
  {
      base.WndProc(ref m);
      switch (m.Msg)
      {
          case 0x312:
          switch (m.WParam.ToInt32())
          {
              case 9000:
              //function to do
              break;
          }
          break;
      }
  }
  </code></pre>
  
  <p>In my WPF aplication I tried do:</p>
  
  <pre><code>AddHandler(Keyboard.KeyDownEvent, (KeyEventHandler)HandleKeyDownEvent);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>private void HandleKeyDownEvent(object sender, KeyEventArgs e)
  {
      if (e.Key == Key.F11 &amp;&amp; (Keyboard.Modifiers &amp; ModifierKeys.Control) == ModifierKeys.Control)
      {
          //function to do
      }
  }    
  </code></pre>
  
  <p>But it works only when my application is active and on the top, but it doesn't work when the application is minimized (for example). Is any method to do it?</p>