Taking Screenshot In RDP while minimize gives an error

I’m trying to take a screenshot of my RDP while running, when minimized. It works well when maximized, but minimizing it gives this kind of error

System.ComponentModel.Win32Exception (0x80004005): The handle is invalid at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation)

I tried to follow the possible solutions online. For reference, I’m using an unattended robot for running, and uses Version 21.4.1 for System Activities and Version 21.4.4 for UiAutomation Activities

If I’m not mistakin, I am using Service Mode for the robot

I don’t know what to do, it used to work before but now It won’t. Also, I’m not sure if this is related but we used to encounter this problem before

Could not load file or assembly ‘UiPath.Interop, Version=, Culture=neutral

We fixed it by updating the packages in .nugget file. So I’m think out packages are up to date.

Hello @Archie

Follow this step on your system(form which where you take RDP) not on RDP Machine to run the process when Minimized


Thanks. We will try this.

1 Like