Menu not set when MDI child is maximized...

Hi!

I have a strange problem with the menu in my MDI app.
The problem is that I want the menu to change when I change MDI window. This works just fine when the MDI isnt maximized. However, when the MDI is maximized the menu stays the same when i switch active MDI window...
Has anyone had this problem before?
My code when I open an MDI window looks like this:

if(!pOpenWnd)
{
HMENU hMenu = ::LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MENU));


return pParent->CreateNewChild(RUNTIME_CLASS(CLonWnd), IDI_LONEKORN, hMenu);
}
else
{
return pOpenWnd;
}
[665 byte] By [par] at [2007-11-18 3:47:54]