Forcing status bar message to update after settext
Posted on 1998-10-20
I have overridden the idle status bar message ("Ready") with my own text by subclassing the CStatusBar object and overriding the OnSetText function. This is the code:
LRESULT CmStatusBar::OnSetText(WPARAM wParam, LPARAM lParam)
CString strMessage = (LPCTSTR)lParam;
if (strMessage == "Ready")
return CStatusBar::OnSetText(wParam, lParam);
where m_sIdleMesg is a CString member variable that is previously set. This function works fine, but doesn't force a redraw so the status bar text doesn't change until something else triggers it, such as tooltips coming on and going off. I've tried UpdateWindow, Invalidate, etc. but how do you actually make the paint happen?