新建一个基于对话框的工程,并连接上一个自己编写的菜单,现在怎么样才能像基于文档
的状态栏一样显示菜单项中的提示语和大写,滚动,数字键?请高手赐教。。

解决方案 »

  1.   

    Using an array idices to maintain a status-bar, 
    Details see MSDN's sample using the keyword - CStatusBar
      

  2.   

    请在CxxDlg.OnSize 事件中写入下面的语句
    CRect rectMain;
            CPaintDC dc(this);
            GetClientRect(rectMain); CRect rectBar ; //工具栏
    CToolBar* m_pwndToolBar = (CToolBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_TOOLBAR);
    m_pwndToolBar->GetClientRect(&rectBar);
    m_pwndToolBar->MoveWindow(0,0,rectMain.Width(),rectBar.Height()+4); //如果不加4,经过若干次最窗口改变大小,则工具栏被完全覆盖
    //状态栏
    CStatusBar*   m_pwndStatusBar   = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR); 
    m_pwndStatusBar->GetClientRect(&rectBar);
    m_pwndStatusBar->MoveWindow(0,cy-rectBar.Height(),rectMain.Width(),rectBar.Height()); //绘制背景色
    dc.FillSolidRect(rectMain,RGB(255,255,255));  //设置为白色