Results 1 to 3 of 3

Thread: Menus in multiple parent windows

  1. #1

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78

    Menus in multiple parent windows

    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?
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.
    Last edited by CornedBee; May 27th, 2002 at 08:04 AM.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Lively Member dubae524's Avatar
    Join Date
    Jun 2001
    Location
    Currently on this Super Star Destroyer being telekinetically strangled to death by Darth Vader
    Posts
    78
    Never mind, don't worry about it. I already figured it out. But thanks anyway.

    BTW I did mean multiple top-level windows.
    - Justin Patrick Butler

    Comme je trouve. "As I find."
    - Butler family quote

    Beneficia sumptos procul superant. "The benefits far exceed the costs."
    - Myself

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width