{
ID_SEPARATOR, // status line indicator
ID_SEPARATOR,
ID_SEPARATOR,
ID_SEPARATOR
};
在OnCreate函数中
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
在OnInitDialog函数中
CRect rct;
m_wndStatusBar.GetWindowRect(&rct);
::MoveWindow(this->GetSafeHwnd(), 100, 100, 800, 600 + rct.Height(), TRUE);
GetClientRect(&rct);
m_wndStatusBar.SetPaneInfo(0, ID_SEPARATOR, SBPS_NORMAL, rct.Width() / 5 - 5);
m_wndStatusBar.SetPaneInfo(1, ID_SEPARATOR, SBPS_NORMAL, rct.Width() / 5 - 5);
m_wndStatusBar.SetPaneInfo(2, ID_SEPARATOR, SBPS_NORMAL, rct.Width() / 5 - 5);
m_wndStatusBar.SetPaneInfo(3, ID_SEPARATOR, SBPS_STRETCH, rct.Width() / 4 - 5);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,ID_SEPARATOR);
//m_wndStatusBar.GetStatusBarCtrl().SetBkColor(RGB(180,180,180));
m_wndStatusBar.SetPaneText(0, _T("中文"));
m_wndStatusBar.SetPaneText(1, _T("无线"));
//m_wndStatusBar.SetPaneText(2, _T("报警"));
m_wndStatusBar.SetPaneText(3, _T("单位"));