CStatusBar m_StatusBar;

UINT array[4];

for(int i=0;i<3;i++)
{
     array[i] = 100+i;
}
m_StatusBar.Create(this); //创建状态栏窗口
m_StatusBar.SetIndicators(array,sizeof(array)/sizeof(UINT)); //添加面板

for(int n=0;n<3;n++)
{
m_StatusBar.SetPaneInfo(n,array[n],0,90); //设置面板宽度
}

//设置面板文本

m_StatusBar.SetPaneText(0,"当前用户:");
m_StatusBar.SetPaneText(1,"andy");
m_StatusBar.SetPaneText(2,"当前状态:");
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0); //显示状态栏