Capture Screen/Windows from Virtual Desktop where we are in main desktop using c#

705 views Asked by At

I am creating a multi desktop application that create and open many desktops in the windows user session,To do this i am using Win32 functions like CreateDesktop,SwitchDesktop, OpenDesktop..Etc. and I create an icon in the task bar, and the user can select one o f the desktops to switch on, everything work fine but...

I want to make a live little image preview of what is happening in every desktop, like Linux does ... so i think in make a screen capture, and showing the image in the control panel, so the user know the desktop that want to switch ...

The problem is that i try many many things, send printscreen key in the desktops, GetDC, BitBlt, CreateCompatibleDC, and many others ... but always either have a black image or invalid handle error. Only when I'm in the virtual desktop, the image show something. but in the others desktops, always black screen.

So can anyone help me with a way to capture images from Virtual Desktop when we are in main desktop.

0

There are 0 answers