title: WPF message handling not respecting the handled argument with RegisterHotKey
body: <p>I have a WPF application that is using the Win32 RegisterHotKey method and an HwndSource.AddHook message handler.</p>
  <p>I am trying to add functionality to not handle the hotkey if I don't take any action by using the HwndSourceHook's handled parameter.</p>
  <p>However, setting handled to false or true does not change the behavior, which always intercepts the registered hotkeys and does not pass them on to the applications they were pressed in.</p>
  <p>I have another application that's using the Windows Forms Application.AddMessageFilter handler, and in that case it's working fine with the same hotkeys when returning false to indicate the message is unhandled.</p>
  <p>The source can be found here: <a href="https://github.com/trevorlloydelliott/eve-switcher/blob/master/HotkeyHandler.cs" rel="nofollow noreferrer">https://github.com/trevorlloydelliott/eve-switcher/blob/master/HotkeyHandler.cs</a></p>
  <p>I have gone so far as to simplify my logic like so:</p>
  <pre><code>        private IntPtr HwndHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
          {
              const int WM_HOTKEY = 0x0312;
  
              if (msg == WM_HOTKEY)
              {
                  handled = false;
                  return IntPtr.Zero;
              }
          }
  
  </code></pre>
  <p>I have also tried not using a Window and an HwndSource hook, and instead using the approach of the <code>ComponentDispatcher.ThreadFilterMessage</code> event to intercept all WM_HOTKEYs and set handled to false like so:</p>
  <pre><code>        private void ComponentDispatcher_ThreadFilterMessage(ref MSG msg, ref bool handled)
          {
              const int WM_HOTKEY = 0x0312;
  
              if (msg .message == WM_HOTKEY)
              {
                  handled = false;
              }    
          }
  </code></pre>
  <p>This also fails to pass the hotkey on to the underlying application. In my tests, I was trying the Tab hotkey with Notepad open. My app would register the Tab hotkey with RegisterHotKey, then set handled to false, but the hotkey never reaches Notepad. As soon as I close my app, it reaches Notepad.</p>
  <p>I am using RegisterHotKey the same way as in my other Windows Forms app.</p>