none
CMFCStatusBar Class and "default" text RRS feed

  • Question

  • Hi All,

    The status bar by default shows a "Ready" or similar text which is defined in the string table resource of the exe.

    You can then also change the text by SetPaneText(0, "Something").

    However it reverts back to "Ready".

    Is there a way of setting it to "Something" so on idle it stays as "Something"?

    The CMFCStatusBar class isn't that well documented.

    Thanks.
    Monday, February 2, 2009 2:01 PM

Answers

  • Its ok,

    I've figured it out, you need to capture the following message:

    ON_MESSAGE(WM_SETMESSAGESTRING, OnSetMessageString)




    LRESULT CMainFrame::OnSetMessageString(WPARAM wParam, LPARAM lParam)
    {
        if (wParam == AFX_IDS_IDLEMESSAGE)
        {
            m_wndStatusBar.SetPaneText(0,m_sStatusBarText);
            return 0;
        }


        return CFrameWndEx::OnSetMessageString(wParam,lParam);
    }


    • Marked as answer by Mark Duffill Monday, February 2, 2009 2:21 PM
    Monday, February 2, 2009 2:20 PM