O
ouech
hi,
i'm still having troubles with my menus
the EnableMenuItem function doesn't seem to work at all
in a MDI. i'm doing exactly the same thing as i did when
i coded a dialog based App with a menu, but it worked.
i just want to disable and gray commands in the menu.
And even when i disable it in the properties in the
ressource editor, it does nothing.
and the stranger is that when i use ModifyMenu,
it transform the menu item into a separator!!.
am i smoking too much or Frames don't let me do anything
with the menu?
i almost forgot but it does the same with my popup menu which
is created with CMenu::LoadMenu and is not a part of my frame...
i give a piece of code but it's has i explain :
BOOL CMdiApp::InitInstance()
{
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
CMenu *menu = pMainFrame->GetMenu()->GetSubMenu(0);
menu->EnableMenuItem(IDM_BOUNCE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
menu->ModifyMenu(IDM_HELLO, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
m_pMainWnd = pMainFrame;
// load the two static menus
return TRUE;
}
thanks,
i'm still having troubles with my menus
the EnableMenuItem function doesn't seem to work at all
in a MDI. i'm doing exactly the same thing as i did when
i coded a dialog based App with a menu, but it worked.
i just want to disable and gray commands in the menu.
And even when i disable it in the properties in the
ressource editor, it does nothing.
and the stranger is that when i use ModifyMenu,
it transform the menu item into a separator!!.
am i smoking too much or Frames don't let me do anything
with the menu?
i almost forgot but it does the same with my popup menu which
is created with CMenu::LoadMenu and is not a part of my frame...
i give a piece of code but it's has i explain :
BOOL CMdiApp::InitInstance()
{
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
CMenu *menu = pMainFrame->GetMenu()->GetSubMenu(0);
menu->EnableMenuItem(IDM_BOUNCE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
menu->ModifyMenu(IDM_HELLO, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
m_pMainWnd = pMainFrame;
// load the two static menus
return TRUE;
}
thanks,