SetCursorPos fail with “the parameter is incorrect” after rdp session terminated

此生再无相见时 提交于 2019-12-03 00:16:26

问题


I have application running on win 2008 server. It is using win32 api and it works just fine when i connected to the server with RDP. When i disconnect every call to SetCursorPos end with this failure. Coordinates (arguments) are same for both cases. Any thoughts ?


回答1:


If RDP is disconnected, it's impossible to do anything with GUI (no screen, no mouse). There are few workarounds though.

  1. Keep RDP open (not in a full screen) and switch to another window on local machine (RDP must not be minimized). In this case your script will work, but it's not fully automated solution because turning your local machine off (when you leaving the office at the end of day) will break RDP session (and your GUI related task). It's not suitable for long running GUI tests.

  2. You may do more complicated automation for a long term: one master server may keep VNC connections (cross-platform analogue of RDP) to every worker machine so that GUI related tasks are running continuously. But there are many pitfalls on this way (especially on Windows). You may require to set up auto logon, to install and customize (with some magic!) VNC server software etc...



来源:https://stackoverflow.com/questions/35008138/setcursorpos-fail-with-the-parameter-is-incorrect-after-rdp-session-terminated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!