title: Move mouse cursor without triggering a WM_MOUSEMOVE
body: <p>I want to trap the mouse in the middle of the window (like in an FPS game) using <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms648394%28v=vs.85%29.aspx" rel="noreferrer">SetCursorPos</a>.</p>
  
  <p>The problem is that when I do, my window receives a WM_MOUSEMOVE -- which at best cancels out any movement that the user intended, and at worst enters a feedback loop.</p>
  
  <p>I've considered reading the position using GetCursorPos and ignoring the message if it's the same as where I'd moved it with SetCursorPos. The problem with this approach though is that the mouse is asynchronous. If the program ever gets behind, then GetCursorPos will return a value different from what I'd expected -- and so it won't know to ignore the message.</p>
  
  <p>Is there a good way to deal with this problem?</p>