Search code examples
c++visual-studio-2010mfcstatusbar

How to disable the CAP NUM SCRL indicators in the status bar of a Windows C++ MFC app?


Default MDI application in MS Visual C++ 2010 shows CAP, NUM, SCRL indicators in the lower right corner. These are not applicable for my application so would like to disable them.

Thanks, Eric


Solution

  • In your CMainFrame class you have this:

    // CMainFrame
    
    IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
    
    BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
        ON_WM_CREATE()
    END_MESSAGE_MAP()
    
    static UINT indicators[] =
    {
        ID_SEPARATOR,           // status line indicator
        ID_INDICATOR_CAPS,
        ID_INDICATOR_NUM,
        ID_INDICATOR_SCRL,
    };
    

    The indicators array is used somewhere later like this:

    m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
    

    Simply remove the ID_INDICATOR_CAPS, ID_INDICATOR_NUM and ID_INDICATOR_SCRL symbols at will.