title: Capture keyboard events while mouse is captured but window not focused (Win32)
body: <p>I'm implementing a custom control that can initiate drag events. I initiate a drag when the user presses the left mouse button by processing <code>WM_LBUTTONDOWN</code> and calling <code>SetCapture()</code>. This causes all mouse events, even those outside my control's client area, to be sent to it, exactly as I want.</p>
  
  <p>I would also like to be able to capture key presses so I can cancel the drag if the user presses the ESC key (<code>VK_ESCAPE</code>). Since my control doesn't have the keyboard focus (and I don't want it to steal the focus away from the control that has it), I can't listen to <code>WM_KEYDOWN</code>. For other reasons too complicated to explain, I also would prefer not to use the  <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646256%28v=vs.85%29.aspx" rel="nofollow"><code>DragDetect()</code></a> function.</p>
  
  <p>How can my control find out about ESC key presses while the drag is ongoing?</p>