Question

I want to use the Desktop Wallpaper in a Bitmap. But in the settings, how it is shown on the desktop!

I know, I can read out the wallaper settings (image used, color and options) in the registry under HKEY_CURRENT_USER\Control Panel\Desktop\, but then I would have to calculate the view myself (Filled, Tiled, etc) to get the same like the desktop shows. Is there an easy way to archieve this? For example, use the same method (via interop) like the desktop does? Or render the desktop-process output again into a bitmap?

I don´t need this for fake-transparency. The Bitmap will be shown in a PictureBox, which size is based on the window size. The content of the PictureBox will be the bitmap. It doesn´t matter if the desktop-icons are rendered too.

Minimizing all applications and take a screenshot is obviously no suitable solution. The user would not forgive me such an annoying program.

Any ideas?

Was it helpful?

Solution

Get the handle of the Shell window:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms633512(v=vs.85).aspx

and grab the window bitmap - see the answer to the following topic:

Capture screenshot of active window?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top