-
Text in status bar
I found this piece of code on the internet
Code:
CString s = "Text";
CStatusBar* p =
(CStatusBar*)AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
p->SetPaneText(1, s);
It is supposed to write some text in the statusbar but I can't get it to work. Is there anyone that have any good ideas about how do do this.
Thanks
-
Never mind I figured out what I needed to do
Code:
void Prog::Test()
{
CString s = "Text";
CStatusBarCtrl* p = (CStatusBarCtrl*)AfxGetApp()->m_pMainWnd->GetDescendantWindow(AFX_IDW_STATUS_BAR);
p->SetText(s,255,SBT_NOBORDERS );
}
That works better