the message loop is provided by the DialogBox function, if you use CreateDialog ( modeless ) you will be using your own message loop. yes you can create a memory block and put a DLGTEMPLATE first then DLGITEMTEMPLATE members all in one contigious block, then pass the pointer of the block into the template paramater as
Code:
CreateDialog( myinst, ( LPDLGTEMPLATE ) myalloc, hwnd, dlgproc );
Creating a non-resource template has its own advantages, but a waste of time for simple dialogs. an unfinished resource can quickly be loaded, then in the WM_INITDIALOG message, creation of variable controls can be done with a few CreateWindow calls