我想将文字输入到状态栏,但不知怎么做?相关的问题:
1、定义状态栏的大小    2、将状态栏的文字删除
   新手上路,请多指教!
   谢谢!!!

解决方案 »

  1.   

    ::SendMessage(hStatusBar, SB_SETTEXT, iPane, (LPARAM)szText);1、
    #define NUM_PANES 3
    int aWidth[NUM_PANES]={x1,x2,...};
    ::SendMessage(hStatusBar, SB_SETPARTS, NUM_PANES, (LPARAM)aWidth);
    2、::SendMessage(hStatusBar, SB_SETTEXT, iPane, (LPARAM)TEXT(""));
      

  2.   

    CStatusBar  m_wndStatusBar;
    m_wndStatusBar.SetPaneText (index,"测试完成!");
      

  3.   

    m_wndStatusBar.SetPaneInfo(1, 0, 0, 250);m_wndStatusBar.SetPaneText(1, "YOUR CONTEXT");
      

  4.   


    static UINT redefine_indicators[] =
    {
    ID_SEPARATOR,           // status line indicator
    ID_INDICATOR_INFO,
    ID_INDICATOR_TIME,
    ID_INDICATOR_CAPS,
    ID_INDICATOR_NUM,
    ID_INDICATOR_SCRL,
    ID_INDICATOR_TITLE,
    };
    if (!m_wndStatusBar.CreateEx(this) ||
    !m_wndStatusBar.SetIndicators(redefine_indicators,
      sizeof(redefine_indicators)/sizeof(UINT)))
    {
    TRACE0("Failed to create status bar\n");
    return -1;      // fail to create
    }
    m_wndStatusBar.GetStatusBarCtrl().SetMinHeight(20);
    m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_INDICATOR_TITLE), "管理平台");void CMainFrame::OnSize(UINT nType, int cx, int cy) 
    {
    CMDIFrameWnd::OnSize(nType, cx, cy);

    SetStatusPanel(cx);
    }void CMainFrame::SetStatusPanel(int nWidth)
    {
    const int nParts = 7;
    int widths[nParts] = {nWidth-420, nWidth-300, nWidth-180, nWidth-145, nWidth-110, nWidth-75, -1};
    if (m_wndStatusBar)
    {
    if (nWidth < 400)
    {
    widths[0] = nWidth*2/5;
    widths[1] = nWidth*11/20;
    widths[2] = nWidth*29/40;
    widths[3] = nWidth*31/40;
    widths[4] = nWidth*33/40;
    widths[5] = nWidth*35/40;
    widths[6] = -1;
    }
    }
    else
    return;
    m_wndStatusBar.GetStatusBarCtrl().SetParts(nParts, widths);
    }void CMainFrame::SetStatusPanelText(UINT nIDFind, CString strText)
    {
    m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(nIDFind), strText);
    CString strBuffer;
    strBuffer = m_wndStatusBar.GetPaneText(1);
    }
    ((CMainFrame*)m_pMainWnd)->SetStatusPanelText(ID_INDICATOR_INFO, "登录操作员【" + m_strOpCode + "】");