Jump to content
  • Advertisement
Sign in to follow this  
wease

How can I draw to the desktop with GetDesktopWindow()?

This topic is 4891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm also trying to draw to the desktop. I found this function GetDesktopWindow() which supposedly returns an HWND to the desktop window. However, when I use this HWND in my CreateDevice function, nothing happens. My program compiles and runs but I see no graphics. If I use a real window though in the CreateDevice function, my program works fine. Any ideas? My alternative is to draw to the desktop by using an activeX control and active desktop. I'm having some trouble getting an HWND to the activeX control though to create the devicel

Share this post


Link to post
Share on other sites
Advertisement
ok, well, I've been shown how to write to the activeX control so that solves my problem...but I would still rather draw directly to the desktop if there is a way and avoid using the activeX control.

Share this post


Link to post
Share on other sites
As far as I know Windows itself is the only 'application' who has the right to draw to desktop. I think that is the reason you don't see anything, although I'm not 100% sure about this.

Share this post


Link to post
Share on other sites
You can call GetDC on the desktop window, and actually draw on it (at least that worked a while back).
But really, you shouldn't. This leads to all kinds of drawing issues as you're not supposed to draw there.
Every other window update will "interfere".

Share this post


Link to post
Share on other sites
perhaps you may consider using "regions". You can create a window whatever shape you like around a bitmap if you define the windows region (rather then the default rectangle). If this special window has the always on top style set, it will always appear infront of everything and is a perfectly legal way of doing things.

Share this post


Link to post
Share on other sites
yeah, I've tried the getDC thing. It works...you can draw on the desktop with it like you said. However, instead, i've opted for the active desktop methods. They work quite well and make drawing on the desktop relatively easy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!