Thread: Child windows - OpenGL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    If you use the WS_CHILD (which you do not have too)

    Don't forget to cast the

    HMENU param

    of the CreateWindowEx()

    as the childs int ID resource.

    MSDN
    "HMENU hMenu, // menu handle or child identifier"

    "hMenu
    [in] Handle to a menu, or specifies a child-window identifier depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. "

    So you should only be able to create one.

    Your code is setting them all to 0.

    May I suggest a STRUCTURE to hold the ID's, HWND's, HDC's, system objects and dimensions of the child windows.

    A loop can then be used to create and later 'clean up' all your allocated / created resources at main window open / close.
    Last edited by novacain; 11-18-2002 at 03:07 AM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  2. openGL text in multiple windows
    By hannibar in forum Windows Programming
    Replies: 1
    Last Post: 03-02-2006, 02:17 PM
  3. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  4. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM