How to Stop Windows from updating mouse position automatically

I recently need a special mouse behavior. When mouse moves, the cursor should not act as the default windows behavior. For example, when moving mouse left, the cursor actually circles clockwise.

The problem is that using SetCursorPos makes the mouse cursor flicking. It's because the default cursor position is different with the new position I set. I need the default windows cursor and cannot implement an owner-draw cursor using GDI or something else for some reasons.

I'm not sure if it is possible to stop the windows cursor from updating automatically.




Answer this question

How to Stop Windows from updating mouse position automatically

  • Torsten Grabs

    How do you change the cursor position

    Are you doing this within a timer or in the WM_MOUSMOVE



  • Max Khlupnov

    Why you are wating for the mouse move messages They are created by windows and don't show every movement. When you are interested in the current actual position you can use GetCursorPos.

    When you receive a WM_MOUSEMOVE messages it is a message from the queue. The actual position might have been changed. Also the might be new WM_MOUSEMOVE messages already in the queue that still reflect "older" positions and might reset you position.
    If you operations take so long and you need to use the new positions you can do this. with GetCursorPos.

    It is no good idea to adjust the messages.



  • SR99

    I'm using WM_MOUSEMOVE. My program renders a lot of objects every frame, so the WM_messages are not peeked frequently enough.

  • How to Stop Windows from updating mouse position automatically