Knowledge Base Nr: 00198 statusbar.cpp - http://www.swe-kaiser.de

MFC: Texte in Statusbar schreiben

  
//memberfunktion zu fensterklasse hinzufügen (name egal)
void SetStatusText(const char* lpszMesage);

void CClickcon3View::SetStatusText(const char *lpszMesage)
{
static CString s_strMessage;

if (s_strMessage == lpszMesage)
return;
s_strMessage = lpszMesage;

CFrameWnd* pWnd = (CFrameWnd*)AfxGetMainWnd();

CWnd* pWnd2 = pWnd->GetMessageBar();
if (pWnd2)
pWnd2->SetWindowText(lpszMesage);
}

//beispiel:
void CClickcon3View::OnTimer(UINT nIDEvent)
{
...
SetStatusText("Automatischen Ablauf abbrechen mit 'ESC'-Taste!");
...
}