Solved

Hiding menu bar in a FrameWnd

Posted on 1998-12-15
3
304 Views
Last Modified: 2013-11-20
How can I get the menu bar to disappear during one view and get it to appear again in another view without deleting it and reloading it ?
0
Comment
Question by:Trilobite
3 Comments
 
LVL 3

Expert Comment

by:plaroche
ID: 1326215
Is it a menubar or the menu of the application?

Menubar: à docking menu like in Visual Studio
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 100 total points
ID: 1326216
Somehow like this:

HMENU savedHandle = NULL;

void HideMenu(CWnd *wnd)
{
  CMenu menu = wnd->GetMenu();
  if ( NULL != menu )
  {
    savedHandle = menu->GetSafeHmenu();
    wnd->SetMenu( NULL );
  }
}

void ShowMenu( CWnd *wnd )
{
  if ( NULL != savedHandle )
  {
    CMenu *menu = CMenu::FromHandle( savedHandle );
    wnd->SetMenu( menu );
    savedHandle = NULL;
  }
}

now you can call this i.e. in any CMainFrame message handler by calling
CMainFrame::AnyFunction()
{
.
HideMenu( this );
.
ShowMenu( this );
.
}

hope that helps,

ZOPPO
0
 

Author Comment

by:Trilobite
ID: 1326217
Thanks a lot.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 94
repeateFront java challenge 31 94
Separate into files by filename 12 87
Bartender label printing - switch on and off graphics 3 54
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question