title: Detect if WM_MOUSEMOVE is caused by touch/pen
body: <p>I am experimenting with WM_TOUCH and want to detect if mouse events are synthesized from touch/pen events or due to an <em>actual</em> mouse event.</p>
  
  <p>The official solution according to <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms703320%28v=vs.85%29.aspx" rel="nofollow">MSDN</a> is to check if the result of <code>GetMessageExtraInfo()</code> has the upper 24 bits set to <code>0xFF515700</code>.</p>
  
  <p>This works. <em>Most</em> of the time. If I use one finger, all is well and good, but if I use more than one, releasing the last one causes a mouse move with <code>GetMessageExtraInfo() == 0</code>. Also, when the window loses focus via touch, up to 3 mouse move messages with <code>GetMessageExtraInfo() == 0</code> are generated.</p>
  
  <p>Is there a <em>reliable</em> way of disambiguating between mouse, touch and pen inputs?</p>