Thread: generic tips before I fall off the deep end

  1. #1
    Shadow12345
    Guest

    generic tips before I fall off the deep end

    I am just starting to realize how the WinApi really works, and I am realizing that there is a whole lot of coding involved.
    Correct me if I'm wrong, but you need to create a new window for everything that the user can click on the screen, you have to set up its properties, register, and show each window. then you have to have a procedure for each window and supply coding for its wm_command message.

    that is what I know so far, correct me where i'm wrong, or clarity or add to what I said.

    Also how do you people organize your code for winapi? Do you have a .h and .cpp file for each window, and then have winmain in main.cpp?

  2. #2
    Jim(U)
    Guest
    Yep - you got it all right. Fun isn't it ?

    Except you don't have to call ShowWindow on each and everyu window/button etc... Set the WindowStyle WS_VISIBLE that does it for you.

    For code organisation... erm.. I guess You'll have to figure that out by yourself. I have around 10-20 files for a project...

  3. #3
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    Also how do you people organize your code for winapi? Do you have a .h and .cpp file for each window, and then have winmain in main.cpp?
    something like that, yeah, although I tend to make everyting in c++ classes.. dunno if it's good
    /btq
    ...viewlexx - julie lexx

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    If you are not using C++ use .c files instead. Will save some common errors (" 'C' type cast required" for SelectObject() is the most common)
    "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. Problem building Quake source
    By Silvercord in forum Game Programming
    Replies: 16
    Last Post: 07-11-2010, 09:13 AM
  2. socket newbie, losing a few chars from server to client
    By registering in forum Linux Programming
    Replies: 2
    Last Post: 06-07-2003, 11:48 AM
  3. Next Question...
    By Azmeos in forum C++ Programming
    Replies: 3
    Last Post: 06-06-2003, 02:40 PM
  4. Replies: 2
    Last Post: 05-10-2002, 04:16 PM
  5. Diving into the deep end
    By Unregistered in forum Game Programming
    Replies: 5
    Last Post: 01-13-2002, 09:43 PM