how to change menubar position?

Visual Studio262
Hi!

I want to owner draw the title bar by using a bitmap in a SDI app, and deal

with WM_NCPAINT message.But the height of the bitmap greater than

SM_CYFRAME, thus the bitmap cover some part of menu.

To avoid this,I increase NCPAINT's height in OnNcCalcSize as following:

if ( bCalcValidRects )

{

int iHi=::GetSystemMetrics(SM_CYMENU);

lpncsp->rgrc[0].left = lpncsp->rgrc[0].left + m_iBorderLeftWidth;

lpncsp->rgrc[0].right = lpncsp->rgrc[0].right - m_iBorderRightWidth;

lpncsp->rgrc[0].top = lpncsp->rgrc[0].top+ m_iTitleHeight;//+iHi

lpncsp->rgrc[0].bottom = lpncsp->rgrc[0].bottom - m_iBorderBottomHeight;

lpncsp->rgrc[1] = lpncsp->rgrc[0];

}

Though the whole NCPAINT's rect is larger, but the menu's top not change,how

to move menubar to a correct position?



Regards,

BrightLee


-