Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...