Desktop background opengl

I have some spare time and want to do smth to desktop. i’m trying to render a opengl scene to my desktop using GetDC(0). NO luck. I was wandering is it possible to write to this context or shoud i use some other method. any help is good :slight_smile: )

Problem: how to render (or draw) a picture to a windows desktop (wallpeper)? with directx or opengl, gdi, anything :slight_smile:

This attempt is doomed using OpenGL.

There are two problems:

First, the desktop window does not belong to your app’s process. Drawing into other processes’ windows is a security problem and must not be allowed by the driver. (Vendors which allow this do the wrong thing and apps relying on it, too.)

The second problem is that under Windows you need to SetPixelFormat on the window you want to render to. This works exactly once! Read the MS manual. Means if you do this on the desktop window, and your driver actually succeeds, your program will only work for the first time and never again until reboot, because the desktop window cannot be destroyed.

You can try to render onto a transparent window which you always make the bottom one in the z-order of the open windows.
Or you could trick something with web features on the desktop, but I didn’t care about those.

There is a NeHe’s lesson that explain very correctly the SetPixelFormat
But I suppose the MSDN is not a bad solution :-p

Thnx ppl. transparent window it will be. But here comes another question, is it possible to make window be at the bottom even if it is selected, so that all icon etc are visible?

Here is a another solution… Render to offscreen pbuffer, grab result in sys memory and then copy frame to directshow graph with one source and one renderer filter. Renderer filter should have overlay and change desktop color to overlay color key.
Place renderers window to be a fullscreen window behind all other windows.
Anyway… take a look in vis plugin in Winamp. Open Settings/Display and check overlay mode and SetDesktop to color.


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.