Hi, I have a static control and am able to paint to it when I, for example click a button by calling InvalidateRect and painting it there and then. I would like to be able to catch WM_PAINT (or what ever it uses) messages for it as well. I tried just painting it in the WM_PAINT section but this messes up the dialog painting. I'm at a loss so any help would be appreciated. Thanks
Posted on 2001-03-07 19:17:00 by Zadkiel
What you're referring to here, is called subclassing, basically taking a control which already exists, and modifying it's functionality in some way. You can either subclass the control or write your own, so you can do this. Some controls have an ownder draw property, which when set makes the control ask the parent window to draw it, sadly static controls do not have this ability.... umbongo
Posted on 2001-03-08 09:18:00 by umbongo
You can either subclass the control or write your own, so you can do this.
It's not the first time I heard this "write your own" but how to? Where to start? Any existing source code of a newly written ListBox? or Edit Control?
Posted on 2001-03-08 10:35:00 by JimmyClif
Thanks umbongo I don't mind using controls with the ownerdraw style if I have to. I think the message is WM_DRAWITEM. Unfortunatly I can't figure out how to get that to work. Does anyone have any sample code.
Posted on 2001-03-08 13:17:00 by Zadkiel
JimmyClif, OK, so it's not as fancy as an edit box or a list control, but I've posted a tut on How to make a Splitter Control It's a simple control, but that's the point of a tut, do something simple to explain the method. This message was edited by Ernie, on 3/8/2001 2:33:19 PM
Posted on 2001-03-08 14:32:00 by Ernie
Zadkiel, A good example of WM_DRAWITEM is in my Icon menu example: Download Here Hope it helps, Xtreme
Posted on 2001-03-09 10:26:00 by xtreme
Ernie, Yep... I've read your tut about the splitter bars and I have to say "RESPECT" ... It's a fascinating piece of work you've done there... I only wish there was more of this sort available. Jimmy
Posted on 2001-03-09 11:49:00 by JimmyClif