试试:if (AfxGetApp() != NULL && AfxGetApp()->m_pMainWnd != NULL)
{
CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
if (pStatus != NULL)
{
pStatus->SetPaneText(0, "hello world");
pStatus->UpdateWindow();
}
}
这里还有很多有关状态条的应用
http://www.codeguru.com/statusbar/index.shtml
{
CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
if (pStatus != NULL)
{
pStatus->SetPaneText(0, "hello world");
pStatus->UpdateWindow();
}
}
这里还有很多有关状态条的应用
http://www.codeguru.com/statusbar/index.shtml
StatusBarMessage("%s你好,你的IP地址为%s, 端口号为%d", SName, SIPAdd, i);//状态行输出信息
void StatusBarMessage(char* fmt, ...)
{
if (AfxGetApp() != NULL && AfxGetApp()->m_pMainWnd != NULL) {
char buffer[256];
CStatusBar* pStatus = (CStatusBar*)
AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
va_list argptr;
va_start(argptr, fmt);
vsprintf(buffer, fmt, argptr);
va_end(argptr);
if (pStatus != NULL) {
pStatus->SetPaneText(0, buffer);
pStatus->UpdateWindow();
}
}
}
CStatusBar* pStatus = (CStatusBar*) AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
.....
pStatus->SetPaneText(0, "ok?");
pStatus->UpdateWindow();