views:

1083

answers:

2

Hi all,

I've found a way to create virtual desktops with c#. Now I was wondering if we can take a screenshot of a particular desktop and if so how ?

Thanks in advance

Blizz

A: 

HAve you tried the CopyFromScreen method in the GFX Object

        Graphics g = new Graphics();
        g.CopyFromScreen(  ....params.... )
Eoin Campbell
I assume with virtual desktop Blizz means a dektop created with CreateDesktop. CopyFromScreen won't work across desktops.
Ben Schwehn
Thanks I'll try that
A: 

I haven't tried it but the first thing I'd try is:

  • create a new thread
  • switch the thread to the new desktop by calling SetThreadDesktop
  • take a screen shot
  • switch thread back

might just work.

Ben Schwehn