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

前端 未结 1 1946
深忆病人
深忆病人 2021-01-29 08:40

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

1条回答
  •  醉话见心
    2021-01-29 09:13

    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...

    0 讨论(0)
提交回复
热议问题