1,定义结构
static UINT BASED_CODE indicators[] =
{
ID_INDICATOR_TIP,
//ID_SEPARATOR, // status line indicator
ID_INDICATOR_CLIENTNUM,
ID_INDICATOR_RUNTIME,
ID_INDICATOR_TIME
};
2,菜单 View ->Resource Symbols 中分配ID
3,在String Table 中设置 Caption
4,
CStatusBar m_bar;
CRect rect;
GetClientRect(&rect);
//Size the four panes
m_bar.SetPaneInfo(0,ID_INDICATOR_TIP, SBPS_NORMAL,rect.Width()-500);
//m_bar.SetPaneInfo(0,ID_SEPARATOR, SBPS_NORMAL,rect.Width()-500);
m_bar.SetPaneInfo(1,ID_INDICATOR_CLIENTNUM, SBPS_NORMAL,rect.Width()-500);
m_bar.SetPaneInfo(2,ID_INDICATOR_RUNTIME, SBPS_NORMAL,rect.Width()-500);
m_bar.SetPaneInfo(3,ID_INDICATOR_TIME,SBPS_STRETCH ,0);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,ID_INDICATOR_TIME);
5,m_bar.SetPaneText(0,_T("服务器停止状态"));