PDA

Click to See Complete Forum and Search --> : Menus in multiple parent windows


dubae524
May 24th, 2002, 03:22 PM
Let's say I have two windows (windows like the Internet Explorer window, or a dialog box window; it's that main parent container window with a title bar and an icon, along with the minimize maximize and close boxes), alright? I am trying to append a menu to each of them:

case WM_CREATE:
hMenu1 = CreateMenu();
hSubmenu1 = CreatePopupMenu();

AppendMenu(hSubmenu1, MF_STRING, ID_MNU_OK, "OK");
AppendMenu(hMenu1, MF_STRING | MF_POPUP, (UINT) hSubmenu1, "File1");

SetMenu(hwnd1, hMenu1);

hMenu2 = CreateMenu();
hSubmenu2 = CreatePopupMenu();

AppendMenu(hSubmenu2, MF_STRING, ID_MNU_YESMAN, "YESMAN");
AppendMenu(hMenu2, MF_STRING | MF_POPUP, (UINT) hSubmenu2, "File2");

SetMenu(hwnd2, hMenu2);
break;

That is the code. The first window's menu appears fine, but the second one's doesn't even appear. Can you help me out with this?

CornedBee
May 27th, 2002, 07:50 AM
I don't really understand what the second window is, but I think menus only apply for top-level windows.

But maybe you just need to call DrawMenuBar to make the menu visible.

dubae524
May 27th, 2002, 11:13 AM
Never mind, don't worry about it. I already figured it out. But thanks anyway.

BTW I did mean multiple top-level windows.