Article ID: 151901
Article Last Modified on 11/21/2006
/* Compile options needed: default
*/
// Following code disables a pane in the StatusBar with ID,
// ID_MYPANE in the CMainFrameClass.
// MainFrm.h : interface of the CMainFrame class
...
class CMainFrame : public CMDIFrameWnd
{
...
//}}AFX_MSG
afx_msg void OnUpdateMypane(CCmdUI* pCmdUI);
DECLARE_MESSAGE_MAP()
};
// MainFrm.cpp : implementation of the CMainFrame class
...
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
...
//}}AFX_MSG_MAP
ON_UPDATE_COMMAND_UI(ID_MYPANE, OnUpdateMypane)
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_MYPANE, //String resource with this ID in resources
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
...
void CMainFrame::OnUpdateMypane(CCmdUI* pCmdUI)
{
pCmdUI->Enable(FALSE);
}
Additional query words: 4.00 4.10 CStatusBar enable
Keywords: kbmfcctrlbar kbprb kbuidesign KB151901