Terminal session when minimized\disconnected returns a blank screen upon capturing desktop snapshot

前端 未结 5 1343
陌清茗
陌清茗 2020-12-15 06:51

I am using the below JAVA code to capture the desktop of a remote machine

    Robot robot = new Robot();
    BufferedImage screenShot = robot.createScreenCap         


        
5条回答
  •  醉酒成梦
    2020-12-15 07:44

    If you minimize the Remote Desktop window, Windows switches the remote session to the GUI-less mode and does not display windows and controls. As a result, TestComplete (or TestExecute) will be unable to interact with the tested application’s GUI, as it does not exist and your automated GUI test will fail. To work around the issue, you can change the Remote Desktop’s registry settings on your local computer (where you launch the Remote Desktop): On your local computer, close all open Remote Desktop sessions. Launch the Registry editor (regedit.exe). Navigate to one of the following Registry keys, depending on whether you wish to modify the Remote Desktop settings only for the current user or for all users on the computer:

    HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client Create a DWORD value named RemoteDesktop_SuppressWhenMinimized and set it to 2.

    Or you can do it programmatically by following steps:

    • Transparent the window
    • Restore the Window
    • Capture
    • Minimize it again
    • Remove transparency

提交回复
热议问题