Main window in Win32 programming

This is a discussion on Main window in Win32 programming within the Windows Programming forums, part of the Platform Specific Boards category; Hey everyone, I read theForger's Win32 API Tutorial for creating Win32 apps today, and it all made sense except for ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Location
    USA::Colorado
    Posts
    155

    Question Main window in Win32 programming

    Hey everyone,

    I read theForger's Win32 API Tutorial for creating Win32 apps today, and it all made sense except for one part. How do you customize the main window? I'm used to creating MFC dialog based projects in Visual Studio 2k8, where the dialog you would see first was right in front of you to edit.

    I know how to use the editor to create other dialogs, however, I am unsure how to edit the main window (its the one with the white background and default menubar). Can I just create a dialog and call CreateDialog() on it instead of CreateWindow() on a new window? I really don't want to hand-code all the elements on to the main window.

    Thanks,

    -Matt
    ~guitarist809~

  2. #2
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    How do you customize the main window?
    customize how ?

    address HINSTANCE

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    If you don't want to hand code the elements, then use a resource editor instead. There is one built into visual studio.
    bit∙hub [bit-huhb] n. A source and destination for information.

  4. #4
    Registered User
    Join Date
    Mar 2006
    Location
    USA::Colorado
    Posts
    155
    Thanks for the responses.

    Thats kinda how I was confused. I know how to use the resource editor, I just don't know how to use it for the main window. I can make dialog's and such, and then display them, however, there is no dialog for the main window in the resource editor, because it's created on the fly w/ the CreateWindow() function. How do I edit this?

    Thanks again,

    -Matt
    ~guitarist809~

  5. #5
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    Oh, I see. You can create your main window as a dialog, or a regular window. If you create it as a dialog, then you can use the resource editor. If the main window is not a dialog, then you need to code the controls yourself.

    Read this to learn how to make your main window a dialog.
    bit∙hub [bit-huhb] n. A source and destination for information.

  6. #6
    Registered User
    Join Date
    Mar 2006
    Location
    USA::Colorado
    Posts
    155
    Thanks - exactly what I needed
    ~guitarist809~

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 04:07 PM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  3. Button positioning
    By Lionmane in forum Windows Programming
    Replies: 76
    Last Post: 10-21-2005, 06:22 AM
  4. opengl help
    By heat511 in forum Game Programming
    Replies: 4
    Last Post: 04-05-2004, 02:08 AM
  5. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 02:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21