How can I draw to the desktop with GetDesktopWindow()?
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
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.
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.
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".
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".
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement