views:

350

answers:

3

How to put a C# programm (ex WPF or WF) under desctop Icons (like a wallpaper)?

  • I want my Old Good XP Active Desktop made by a some open source C# programm on my Win 7!)

  • Something like this - Fences . They have there "windows" appearing underneath icons. I do not want to manage Icons - just put my window under them... BTW any one knows about such operations in other OS’s (Mac etc)?

  • And I DO NOT WANT TO MANAGE ALL THE ICONS ON MY OWN LIKE bumptop

+1  A: 

Short answer is you can't really do it (in managed C# anyway). If it's possible, you would need to use Interop, and you'd likely be calling something that Windows doesn't offer as an API.

... although... as Ole Jak mentioned, Stardock looks to be doing it somehow...

The desktop is its own contained item. The same process handles the icons and the wallpaper "behind" those icons.

You are allowed to change the wallpaper to a different image, and you used to be able to create an Active Desktop where HTML content would be displayed, but this was discontinued in Vista.

What are you actually trying to do? Maybe there's another way to achieve a similar result?

Damovisa
I want my Old Good XP Active Desktop made by a some open source C# programm on my Win 7!)
Blender
The problem with that is you're talking about the core of the operating system - it's incredibly hard to do anything with that unless Microsoft wants you to!
Damovisa
You say that the desktop is core... Hm... But for ex they http://www.stardock.com/products/fences/ have there "windows" appearing underneath icons. I do not want to manage Icons - just put my window under them... BTW any one knows about such operations in other OS’s (Mac etc)?
Blender
Ok, that program is interesting... My guess is that they're using some quite low-level operations rather than calling an established API. I honestly don't know how they're doing it. Maybe they're removing all icons and duplicating their behaviour in their own program?
Damovisa
A: 

There was DreamScene for vista. You could put a video as explorer background. I dont know if you could run a C# program to output the background video.

Andrew Keith
run a C# program to outputvideo is not so hard but how to set it as the back and if we for ex want to interect with it...
Blender
+1  A: 

I think it is quite possible, try this:

  1. Find handle to window with the class "Progman".
  2. Create some window in your application (or, perhaps, in some separate application, you will see the purpose later) and turn off its borders.
  3. Set the parent of the newly created window to desktop handle.
  4. Set the parent of "Progman" window you have found previousely to the window you created.

Desktop will be put on a window owned by your application and it will be possible to manipulate it in the way you want (namely, put something under it).

Also, do not forget to restore desktop's parent when application owning it is closed.

Look for FindWindow, GetClassName and SetParent at http://www.pinvoke.net/

freegoods