SridharR-0383 avatar image
0 Votes"
SridharR-0383 asked JackJJun-MSFT commented

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

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

· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you mean a computer with two displays or two separate desktop computers?

0 Votes 0 ·

A computer with virtual desktops feature provided in windows 10 and 11

0 Votes 0 ·

@SridharR-0383, you could try to use Screen.AllScreens to get the screenshot of the window you wanted.

Please refer to the link: screenshot-from-second-screen

0 Votes 0 ·

Jack, I am not looking for dual monitor nitor screenshot, looking for capturing image from virtual desktops(this feature is now available in windows 10)

0 Votes 0 ·

@SridharR-0383, do you mean the shortcuts by shift+windows+s to capture image?

0 Votes 0 ·

0 Answers