views:

497

answers:

4

I'm trying to make an application that needs to draw on the desktop, behind the icons so it appears to replace the desktop wallpaper. I've found a few solutions to this, but most of them didn't work very well (lots of flickering). One solution seems to be what I'm looking for, but I don't really get it. I've done mostly C# applications using either higher-level graphics libraries or just Windows Forms, and some C++ but only on non-Windows platforms.

If anyone could "translate" it for me or provide me with an alternative solution, it would be much appreciated!

A: 

Can't you just replace the desktop wallpaper, then when your application exits restore it?

Philip Wallace
The thing is, I'm looking to continuously update the screen. Constantly changing the desktop wallpaper would be quite slow of course.
nardi
A: 

Yes, with interop, see this thread.

luvieere
That would draw on top of everything; I'm looking to draw behind everything (except the desktop wallpaper).
nardi
A: 

You can find inspiration in the VLC media player code. there's a wallpaper mode that does what you're looking for.

Géal
+2  A: 

I never found the solution I wanted, but here are the best (only?) alternatives:

  • Draw to the "SysListView32" window (ProgMan -> SHELLDLL_DefView -> SysListView32). This will draw behind the desktop icons, but will flicker when animation is used. How to: Link (you'll have to use interop in .NET).

  • Use DirectDraw overlays. If you don't know what those are; you set the desktop color to a certain obscure color and everything with that color will be replaced with what's on the overlay. This is used in the example in my question and in the VLC wallpaper mode. However, this is incompatible with Aero. How to: Link (I guess you could use Managed DirectX in .NET?).

nardi