I want to draw a button in the menu bar. So I intercept the message
WM_NCPAINT and in the handler I do like the following.
void OnNcPaint()
{
Default();
CDC* pDC = GetWindowDC();
...;
pDC->Draw...
}
This way can work except that when the window is deactivated my own button
disappears. If I resize the window, the button shows again. So I comment
the line : Default(); Make it not call the default implementation. To my
supprise that the window's caption and menu bar can still be shown. I
had thought that windows draws the caption bar and menu bar in the handler
of WM_NCPAINT. But it seems that it doesn't. Why?
Regards,
Johnny.
On the handler of WM_NCACTIVATE, the default window proc will redraw
the non client area. But it draws the area by calling the internal function
directly I think, because sending message of WM_NCPAINT has no effect.
Johnny.
"johnny" <johnn...@witron.com.cn> wrote in message
news:OVqa1vVMCHA.388@tkmsftngp09...
See rather long article at
http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0197/c++/c++0197.htm
&nav=/msj/0197/newnav.htm
that deals with this topic.
--
Gary