Desktop screen capture from screensaver?

lynchbags

Newcomer
Joined
Nov 7, 2005
Messages
1
I'm building a screensaver using C# and Managed DirectX. I would like to use a screenshot of the users screen right before the screensaver started within the screensaver. The problem I'm running into is that under Windows NT/2000/XP the screensaver runs under a desktop named "screensaver", while the main user screen runs under a desktop named "default". If I do a screen capture from the screensaver when it isn't running in preview mode all I get is the background image because explorer and all the users windows are open under the "default" desktop. If I do a call to OpenDesktop to get a handle to the default desktop, and then call SetThreadDesktop to set the current thread to run under the context of the default desktop then all I get for a screen capture is a black image. It seems like calls to SwitchDesktop from a screensaver fail, so I don't think switching back to the default desktop just long enough to to grab a screenshot of the users desktop from the screensaver is going to work either. Does anybody have any ideas on how to do this?
 
Back
Top