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

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

    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
    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, 11:47 AM
  5. CreateWindow() help!
    By nextus in forum Windows Programming
    Replies: 3
    Last Post: 03-05-2003, 02:56 AM