Thread: Putting a Window in a class

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    Putting a Window in a class

    Right, I've thrashed around with this nightmare for a while and produced nothing. With the help of a friend I've come to a conclusion that I want to try and create a class for window creation so that's it's more readily accesible. Does anyone have any ideas how you would put that into action?

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    For creating a Window C++ class you need the following:

    You'll want a static WndProc, an HWND member, and a Callback method. To get from the WndProc to the Callback you'll need a little something called SetWindowLong() with GWL_USERDATA. You'll see what I mean when you start wrapping it.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You can take a look at MFC's CWnd class to get some ideas as well.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  3. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM