7.4. How do I turn off the toolbar or status bar?

Microsoft Visual C++/Microsoft Foundation Classes


7.4. How do I turn off the toolbar or status bar?

You can turn the status bar off in any of your views (i.e. in the OnViewStatusBar() method you describe above) with the following code:

if( ((CMainFrame*)GetParent())->m_wndToolBar.IsWindowVisible() )
{
    GetParent()->SendMessage(WM_COMMAND, ID_VIEW_TOOLBAR, 0L);
}
if( ((CMainFrame*)GetParent())->m_wndStatusBar.IsWindowVisible() )
{
    GetParent()->SendMessage(WM_COMMAND, ID_VIEW_STATUS_BAR, 0L);
}

Use 1L instead of 0L for the SendMessage's lParam to turn the bars on.

[email protected] via mfc-l, 5/16/95