DialogBoxIndirect(...) vs. WNDCLASS, CreateWindow etc.

This is a discussion on DialogBoxIndirect(...) vs. WNDCLASS, CreateWindow etc. within the Windows Programming forums, part of the Platform Specific Boards category; Hello, I'm just wondering, if you were just after a standard window to use in your program, wouldn't it be ...

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255

    Question DialogBoxIndirect(...) vs. WNDCLASS, CreateWindow etc.

    Hello,

    I'm just wondering, if you were just after a standard window to use in your program, wouldn't it be quicker and smaller to just:-
    Code:
    // g_hInstance: global variable for instance handle
    // DialogProc:  Dialog window procedure
    DWORD *dwDialog;
    
    dwDialog = malloc(24); // Minimum size for a dialog template
    DialogBoxIndirect(g_hInstance, dwDialog, NULL, DialogProc);
    free(dwDialog);
    Than to fill out a WNDCLASS(EX) and call RegisterClass(Ex), CreateWindow(Ex), etc.? You can set the styles in the first two DWORDs (Low and high words), although the window title must be in Unicode in the array, so you might wanna do it in DialogProc's WM_INITDIALOG message, along with sizing the window to your requirements.

    Yes, I'm a freak.

  2. #2
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    Well that would seem quicker but would it be as easy to manage long term?

    It's probably easier to have a wrapper for a app window.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CreateWindow failure
    By TheDan in forum Windows Programming
    Replies: 6
    Last Post: 07-08-2005, 07:49 AM
  2. Replies: 2
    Last Post: 05-29-2005, 10:06 AM
  3. getting fed up with CreateWindow
    By ... in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2003, 03:42 PM
  4. Wndclassex And Wndclass
    By rip1968 in forum Windows Programming
    Replies: 3
    Last Post: 03-15-2003, 10:47 AM
  5. CreateWindow() help!
    By nextus in forum Windows Programming
    Replies: 3
    Last Post: 03-05-2003, 01:56 AM

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