3
votes

When reading mouse position in WM_INPUT event, and the mouse cursor is hidden, it seems SetCursorPos does not work when the app is used through remote desktop.

The same exact code works fine when the app is not used through remote desktop. i.e. I can get infinite mouse movements in all directions just fine, since SetCursorPos properly moves the mouse cursor at center of screen when the app is accessed locally.

Is it a limitation (perhaps security related) of SetCursorPos when accessed from remote desktop? Or is there a work-around to this? Or perhaps it is because the mouse position values are absolute (MOUSE_MOVE_ABSOLUTE bit is set)?

All values I read from WM_INPUT are not affected whatever I set in SetCursorPos.

Any help appreciated, thanks!

2

2 Answers

1
votes

It seems that this behavior is related to the handling of SetCursorPos (and mouse events) in RDP or VM environemnts desribed in https://communities.vmware.com/thread/189519

0
votes

It's a really old thread, but in the current world situation, it might be helpful.

To fix problems with RDP and mouse you need to open Local Group Policy Editor and go to: Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Remote Session Environment.

In the Remote Session Environment you need to set Use WDDM graphic display driver for Remote Desktop Connections to disable.

Probably Windows 10 Pro is required, but I can't check it. This change you need to make in the machine you want to connect to (host). Restarting Windows is recommended.