Hello,

Is there a way to hide the menu bar at the bottom of the screen in dialog
box? I created a MFC dialog box application and put the following code in the
OnInitDialog function:

-- code snippet begin --

SHMENUBARINFO mbi;
ZeroMemory(&mbi, sizeof(SHMENUBARINFO));

mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = GetSafeHwnd();
mbi.dwFlags = SHCMBF_HIDDEN;
// also tried using the SHCMBF_HIDESIPBUTTON flag with the HIDDEN flag
SHCreateMenuBar(&mbi);

-- code snippet end --

That didn't seem to work. It works when I created a Windows application and
put the code in response to the WM_CREATE message.

The other thing that would work for me is if I can draw over that menu bar
area.

Thank you in advance for your help.

----
mark

RE: Hiding menu CDialog by marklt88

marklt88
Fri Feb 29 16:19:06 CST 2008

Answering my own question in case anyone else is interested in, I found the
answer here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=118771&SiteID=1

Extracting the juicy parts:

BOOL Ctest_fullscreenDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SHINITDLGINFO sid;
sid.dwMask = SHIDIM_FLAGS;
sid.dwFlags = SHIDIF_FULLSCREENNOMENUBAR;
sid.hDlg = m_hWnd; ::SHInitDialog(&sid);
HWND hBar =SHFindMenuBar(m_hWnd);
::ShowWindow(hBar,SW_HIDE);
......


--
----
mark


"marklt88" wrote:

> Hello,
>
> Is there a way to hide the menu bar at the bottom of the screen in dialog
> box? I created a MFC dialog box application and put the following code in the
> OnInitDialog function:
>
> -- code snippet begin --
>
> SHMENUBARINFO mbi;
> ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
>
> mbi.cbSize = sizeof(SHMENUBARINFO);
> mbi.hwndParent = GetSafeHwnd();
> mbi.dwFlags = SHCMBF_HIDDEN;
> // also tried using the SHCMBF_HIDESIPBUTTON flag with the HIDDEN flag
> SHCreateMenuBar(&mbi);
>
> -- code snippet end --
>
> That didn't seem to work. It works when I created a Windows application and
> put the code in response to the WM_CREATE message.
>
> The other thing that would work for me is if I can draw over that menu bar
> area.
>
> Thank you in advance for your help.
>
> ----
> mark