Say I have a normal window with some text boxes / buttons etc on it. How can I draw over these controls? I'm talking about simple GDI shapes here, not bitmaps. They can be positioned over multiple controls and the main window at once, so it's no use just drawing in the control's client area. I had the idea of intercepting WM-PAINT msg's to these controls, and then not drawing on the parts that are overlapped by the GDI shapes. This doesn't work (the way I did it anyway...).

BTW: This is a window in my own program.
Posted on 2001-08-25 03:48:39 by Qweerdy
i think the only possibility is to draw on the desktop hdc. then you have the possibility to overwrite everything on the screen.

but actually i'm not sure. sorry.

Posted on 2001-08-25 04:02:52 by NOP-erator
There are a couple of methods available to you.

1) You could place a static label over the entire window and use regions as you draw to it to make areas where you daw nohing trnsparent.

2) If you want very basic shapes you could create a static label for each one again using regions to shape them. In this way as well you would be able to mave the shapes around.

3) Again using a label you could get the desktop dc before you create the label. Then place the label over your window and blt the proper rectangle from the desktop dc onto it. You could then draw to it as you please

Noneo f these methods may suit our needs, it all depends on what exactly you want. Give us some more info.
Posted on 2001-08-25 05:11:41 by Eóin
I'll try those options out, see what works. This program was meant as a joke program, and some practice in GDI stuff for myself. The basic idea is a ball bouncing in a normal window, like it was a pinball table. However, it should only bounce off any (raised) buttons.

Thanks for the help!
Posted on 2001-08-26 01:29:07 by Qweerdy
Well if thats what you want then the best method I can think of is to use my second suggestion and create a static label with a circular shaped region.

Then you wouldn't even need to redraw this, just move the label around.
Posted on 2001-08-26 06:43:11 by Eóin
Qweerdy, that sounds like a funny idea. Can't wait to see it! :tongue:
Posted on 2001-08-26 11:32:06 by bitRAKE