本代码在VC6.0中测试通过
在对话框类中定义
public:
CStatusBar m_StatusBar;
在对话框初始换函数中
static UINT indicators[2] =
{
ID_SEPARATOR,
ID_SEPARATOR,
};
if (!m_StatusBar.Create(this) || !m_StatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
{
TRACE0( "Failed to create status bar/n ");
return FALSE; // fail to create
}
m_StatusBar.SetPaneInfo(1,ID_SEPARATOR,SBPS_NORMAL,130); m_StatusBar.ShowWindow(SW_SHOW);
CRect rect;
GetClientRect(&rect);
m_StatusBar.MoveWindow(0,rect.bottom-StatusBarH,rect.right,StatusBarH,TRUE);
m_StatusBar.SetPaneText(0," 0532-89087078转8020");
m_StatusBar.SetPaneText(1,"LPRS V1.0");