Help: Drawing OpenGL to the desktop

I have been trying for some time to draw my OpenGL scene to the desktop behind the windows and icon but I cannot figure it out. I have tried using the HDC of the SysListView32 but that draws over the icons. Could somebody please give me a link to a site explaining this? Or good keywords to search with in google?

your keywords are:
ActiveDestktop (Animated Background)

Keywords in what search engine?
They certainly don’t mean anything to google…

But on the other hand,
ActiveDesktop (Animated Background)

do mean something.

[This message has been edited by knackered (edited 09-05-2002).]

So it’s not posible to draw to just that surface? I need to make a webpage with an imbeded activex control that does opengl?

I did search for those in google, i didnt gat ANYTHING usefull, what should I use?

I wrote a program which grabs the window’s handle, then I create an rendering context from it. After that I can render straight to it. Hey, desktop is a window too.

Yes, but the icons are children of that window, and therefore get drawn over when you swapbuffers. He wants the icons to stay untouched - probably in the same way Drempels works:-


But I was looking at milkdrop, but I think it’s made by the same people. They use DX though rite?

is there a way to draw only the area not covered by children?

Christ, I’ve never seen that Milkdrop before (been a while since I’ve been to that site) - that is an INCREDIBLE plugin!!!
That is absolutely beautiful, and very very clever.


But…how do i not draw overtop the icons? Is there a specific hdc not just for that SysListView32 but for that one layer that makes up the background? Can I get that maby? or are the icons and background drawn to the same hdc?

I think i figured out how they did it. I was on the internet lookin at some stuff…and i noticed some dark blue text was twinkling, and its the same color as the background to my desktop, so i guese maby they go over all hte pixels on the screen and color all the pixels that color with opengl stuff.

How do you do that?

From the Milkdrop documentation:-
Tweak Overlay Filter Color

Allows you to change the ‘bluescreen’ color for MilkDrop. When
MilkDrop runs in Desktop Mode, the first thing it does is replace
your wallpaper with a solid image of a single color. The default
color is (15,0,15), which, hopefully, is one you don’t use too
often. Then, whenever it’s time to show you a frame of animation,
it replaces all the colors on your screen that would be (15,0,15)
with the MilkDrop image instead. Setting this color to (0,0,0) or
(255,255,255) can have fun side effects.

So there you have it. It does indeed use a ‘blue screen’ technique to mask out the icons etc.
I think the only way to do this in opengl would be to use a pbuffer to draw your stuff into, then do a glreadpixels or something to copy the contents of the pbuffer into a ddraw surface, and then blit that surface onto the desktop using its masking functions.

why go through all that? Cant you just read the pixel and draw the pixel to the hdc of the ShellList…32? without using the blit stuff? and ddraw?

what are you talking about? If you draw into the desktops dc, you’ll overwrite the icons on the swapbuffer. Clarify what you think you can do…

Even if i only set pixels that are of the color of the background?

Originally posted by napalm21:
Even if i only set pixels that are of the color of the background?
You can’t. Not with OpenGL alone.

Another way would be to have a fullscreen window that stays in the background, but doesn’t cover the taskbar.

There was a method for retreiving the icons of the desktop. So you render those as textures on your fullscreen. If user clicks on it, you would have to execute the “icon”.

A little complicated, but it would work on all Windows.


I think i got it but i havent tested it enough.

When my comp crashes, and it does alot, active desktop turns itself on. dunno why, it just does. So after i restarted I opened my project back up, and spy ++ and went back to work, and in spy ++ instead of progman just having a straight linear branch of kids, there was another branching off of one, so i drew to that, and im asuming that that is the window to active desktop. when i cleared the window, the backround turned black(color of my clear) and the icons stayed, but i havent tested it enough yet. Im afraid after i get my new program running that the active desktop will try to draw itself over my ogl stuff. Is there a way to make a blank active desktop?

I am pretty sure that that Milkdrop uses a video overlay. A video overlay does automatic color keying. They are accessable through the DirectShow API.

[This message has been edited by Nakoruru (edited 09-07-2002).]

Yea it does, but I want to do it using only opengl.

The active desktop works, but its realy realy slow. Is there a way to pause the active desktop’s process or somthing like that?

Why not use DirectShow and OpenGL at the same time? It is not like the program is going to be portable.