The but_wndproc should handle all the messages and repainting. Unfortunately some
messages such as WM_DRAWITEM and WM_COMMAND go to *parent* window WndProc and not
but the subclassed but_wndproc. I don't want that. The messages should go
straight to but_wndproc.
Now I am just doing a PostMessage from WndProc to but_wndproc for WM_DRAWITEM and
WM_COMMAND. But my main WndProc is getting messy when I have all sorts of owner
drawn controls and I have to determine what shoult get posted and to which
subclassed WndProc.
I there any way to make for example WM_DRAWITEM go directly to the the subclassed
WndProc?
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
The whole intent of BS_OWNERDRAW (and the other owner-draw styles) is so
that you _don't_ have to subclass the control's window procedure. They
save the effort of writing a subclassing procedure because they allow
you to do the drawing in the parent window procedure or dialog procedure
with you have write in any case.
If, for any reason, you prefer to use subclassing, don't use the owner
draw styles. Just handle the WM_PAINT (and possibly WM_NCPAINT) messages
in the subclassing procedure and do the painting there.
--
Norm
To reply, change domain to an adult feline.