   Relative Mouse Coordinates in Windows
  Hey everyone,I'm working on a small project where I need to use relative mouse coordinates in Windows (MSVC, C++). Since I'm using GetAsyncKeyState for reading Mouse/Keyboard presses, I'd like something fairly lightweight (ideally in the Windows SDK). I've looked into using DirectInput, but it's considered deprecated. I've looked at Raw Input Data in Windows, but it seems like too much work to simply request 1 piece of information. I could figure out relative positioning based on the last position of the mouse, but when I leave the current window or hit the edge of the windows desktop it stops reporting data, so I'm stuck!Does anyone have any suggestions? Thanks!   
  Something like?:GetCursorPos(&CurrentPoint);Relative = CurrentPoint - (500,500)SetCursorPos(500,500)   ;  If you want to continue to get mouse messages after you've left your window, you can use the SetCapture Function.You should call ReleaseCapture(), when you no longer need to track outside your window.If you then want to translate the coordinates returned relative to your window, you can use MapWindowPoints.   