Problem in adding menu to dialog
- From: neo <neo@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Oct 2008 00:05:01 -0700
Hi
i have a dialog based application in evc4 where i am trying to add a menu.
I have created a menu resource "IDR_MENU1" and am tryingto add it to my
dialog.
BOOL CHelloDlg:nInitDialog()
{
CDialog:nInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CenterWindow(GetDesktopWindow()); // center to the hpc screen
// TODO: Add extra initialization here
//My Code
SHMENUBARINFO mbi;
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = this->m_hWnd;
mbi.dwFlags = SHCMBF_HMENU;
mbi.nToolBarId =IDR_MENU1; // this is menu resource ID
mbi.hInstRes =AfxGetInstanceHandle();// g_hInst;
SHCreateMenuBar(&mbi);
return TRUE; // return TRUE unless you set the focus to a control
}
i see that the menu is created but is not part of the dialog box.
In fact it becomes part of the main window i.e the menu can be seen at the
bottom of the emulator window.
How can i make the menu to be a part of the Dialog box of my application??
.
- Follow-Ups:
- Re: Problem in adding menu to dialog
- From: r_z_aret
- Re: Problem in adding menu to dialog
- Prev by Date: Re: How to know if a network adapter is connected
- Next by Date: Re: How to know if a network adapter is connected
- Previous by thread: Not a Valid WIN32.exe
- Next by thread: Re: Problem in adding menu to dialog
- Index(es):
Relevant Pages
|