How to capture screenshot of a window in desktop 2 when we are in desktop 1 using c# in windows 10/11

Sridhar R 1 Reputation point
2021-10-25T09:59:30.51+00:00

Can anyone please help me how to capture windows running/located in desktop 2 when we are in desktop1 using c# in windows 10/11:
Working on a automation project which has to work in desktop 2 and I have to take screenshot of each step. I tried lot of ways but all are taking desktop 1 screenshot instead of desktop2 but my automation will run in desktop2

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.