|
Posted by Tim on February 27, 2006, 2:05 am
Please log in for more thread options
I use the code below:
void DDView::SetMenu(int nResMenuId)
{
HWND hWndOldMenu = SHFindMenuBar(m_hWnd);
if (hWndOldMenu) {
DestroyWindow(hWndOldMenu);
}
// create the menu bar
SHMENUBARINFO mbi;
ZeroMemory(&mbi, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = m_hWnd;
mbi.nToolBarId = nResMenuId;
mbi.hInstRes = g_hInstance;
if (!SHCreateMenuBar(&mbi)) {
// Couldn't create the menu bar. Fail creation of the window.
return;
}
m_hMenu = mbi.hwndMB;
UpdateWindow(m_hMenu);
}
I call the SetMenu(...) with different MENUBAR id,
it doesn't work. although I see the menubar is changed. but I cannot clicked
the menu item.
any item.
|