想在状态拦里生成其他的控件如按钮,ProgressCtrl等 CStausBar是CStatusBar的派生类。
我的代码:int CStausBar::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (CStatusBar::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect(0,0,0,0);
m_Btn.Create("Botton",WS_CHILD,rect,this,IDC_Button);
CFont *pFont=CFont::FromHandle((HFONT)::GetStockObject(ANSI_VAR_FONT));
m_Btn.SetFont(pFont);
    //m_Btn.SetWindowText("安下");
m_progress.Create(WS_CHILD|WS_VISIBLE,rect,this,IDC_progress);
       // TODO: Add your specialized creation code here

return 0;
}
void CStausBar::OnSize(UINT nType, int cx, int cy) 
{
CStatusBar::OnSize(nType, cx, cy);
UINT intx;
CRect rect;
intx=CommandToIndex(IDC_Button);
GetItemRect(intx,&rect);
    m_Btn.MoveWindow(rect);
intx=CommandToIndex(IDC_progress);
     GetItemRect(intx,&rect);
    m_progress.MoveWindow(rect);
// TODO: Add your message handler code here

}
没有效果,不知道怎么回事,求救!!!