0
votes

I am performing MouseClick actions by using PostMessage WinApi, is there any way to simulate MouseMove with it too without any need of window focus so I can still use my cursor for other tasks? I am aware of the lParam parameter of PostMessage but it only takes effect when I set my mouse pointer inside of the DirectX window.

SetCursorPos is not the solution as I want to perform MouseMoves without hijacking the cursor.

I hope that makes sense, Thanks

1
Do you mean that posting WM_MOUSEMOVE / WM_NCMOUSEMOVE doesn't help? - Alex Guteniev

1 Answers

0
votes

There are a lot of places more than WM_MOUSEMOVE message lParam.

There is GetMessagePos function. It can be faked by setting Windows Hooks and altering MSG::pt, so call to GetMessagePos will return simulated cursor position instead of actual.

But there is GetCursorPos, and probably some other ways to get mouse position, like WM_INPUT. I think that ultimately only moving cursor (by SetCursorPos or by SendInput) could cover most of them.