Skip to main content
gamedev.net
🔒 Locked

Rendering to Desktop

Started by mscava Mar 10, 2008 at 5:26 PM 4 replies 1.3k views
Original Post
mscava
mscava
Hi! I'm trying to create a simple application using .NET (C#) and late DirectX, that would be capable of rendering onto the desktop. By the desktop I mean the surface under all the windows and icons. I've searched this forum for some examples and most of them recommended me using a DirectDraw, which is already deprecated. My question is wheter there is a simple (or harder) way to do it without using DirectDraw? And how? Thanks for replies..
Buckeye
Buckeye
I don't know if you can render directly to the desktop (I've never tried it), but you can render to a target surface and then set the texture as wallpaper.

I haven't done this all in combination, but the individual pieces work.

If you want an untiled image, get the size of the desktop.

RECT Desktopsize;
GetClientRect(GetDesktopWindow(),&DesktopSize);

Setup a render target with the desk top size.

Render to the target.

Save the texture with D3DXSaveTextureToFile.

Set the wallpaper using IActiveDesktop::SetWallpaper.

If you're adventuresome, you could try attaching your directx device to the HWND returned from GetDesktopWindow and see what happens.
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly. You don't forget how to play when you grow old; you grow old when you forget how to play.
stupid_programmer
stupid_programmer
Quote:
Original post by Buckeye
If you're adventuresome, you could try attaching your directx device to the HWND returned from GetDesktopWindow and see what happens.


You have to be able to do something like this I think. My ATI TV tuner can display the TV image on the desktop behind the icons.

fladur
fladur
Quote:
Original post by stupid_programmer
Quote:
Original post by Buckeye
If you're adventuresome, you could try attaching your directx device to the HWND returned from GetDesktopWindow and see what happens.


You have to be able to do something like this I think. My ATI TV tuner can display the TV image on the desktop behind the icons.


I dont think its posible to draw directly to the desktop, i tried it and all i got was a slow computer with the same desktop, if someone finds the way to do it please let me know how
Don't forget to visit my blog here.
Hey! Just let noobs be noobs, after all, we once were noobs right?
Hello Kitty
Hello Kitty
if (LockWindowUpdate(GetDesktopWindow())) {
// Do your "stuff"
.
.
.
LockWindowUpdate(NULL);
}
-goodbye-
mscava
mscava
Quote:
Original post by Hello Kitty
if (LockWindowUpdate(GetDesktopWindow())) {
// Do your "stuff"
.
.
.
LockWindowUpdate(NULL);
}


Did this work for you?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.