Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Add Menu???

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2001
    Posts
    20

    Add Menu???

    This is my code:


    // Create The Window
    if (!(hWnd=CreateWindowEx( dwExStyle, // Extended Style For The Window
    "JOEY", // Class Name
    title, // Window Title
    dwStyle | // Defined Window Style
    WS_CLIPSIBLINGS | // Required Window Style
    WS_CLIPCHILDREN, // Required Window Style
    0, 0, // Window Position
    WindowRect.right-WindowRect.left, // Calculate Window Width
    WindowRect.bottom-WindowRect.top, // Calculate Window Height
    NULL, // No Parent Window
    NULL, // No Menu
    hInstance, // Instance
    NULL))) // Dont Pass Anything To WM_CREATE
    {
    KillGLWindow(); // Reset The Display
    MessageBox(NULL,"Window Creation Error.","ERROR",MB_OK|MB_ICONEXCLAMATION);
    return FALSE; // Return FALSE
    }

    let say i want to add a menu bar to the window with simple FILE,EDIT,VIEW,WINDOW,HELP etc....
    How do i edit my code (NULL,// No Menu) above??
    if i have a parent window, how do i change(NULL,// No Parent Window) coding above??\


    Any help is appreciated....
    Thanks for reading through the code....

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: Add Menu???

    Hi !

    Not much OpenGL there is it ;o)

    You have to create the menu with the CreateMenu() functions and friends, then you get a HMENU handle you can pass on to the function when you create the window.

    Mikael

  3. #3
    Intern Newbie
    Join Date
    Nov 2001
    Location
    The netherlands
    Posts
    46

    Re: Add Menu???

    If you are using MSV you can use

    LoadMenu( NULL, MAKEINTRESOURCE(IDR_MENU) );

    where IDR_MENU is a menu in your resource.

Posting Permissions

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