Does the window size vary according to the number of items in it? If it does, work out what size you want and use SetWindowPos to resize it. In fact, the easy way is not to half design it: just dump all the controls you want on the dialog, strategically positioned either horizontally or vertically. In the program, read the position, and position the other controls relative to your strategically positioned controls. Then resize the dialog.
Note of warning if you do it this way:
1) there are two routines: GetWindowRect and GetClientRect. WindowRect returns the coordinates relative to the top left corner of the screen. ClientRect is the client area so the top left corner is always 0,0
2) When SetWindowPos is called, it expects the coordinates to be relative to 0,0 (tlc in the example below) of the client area.
3) The difference between the window width and the client width divided by 2 is the border width. Add this to the client height and subtract from the bottom window position to get the top left corner of the client area.
4) MoveWindow is a good alternative to SetWindowPos if you don't want to play with Z orders and all the other strange bits.
Code:
RECT crect, wrect;
LONG borderwidth;
POINT tlc;
GetClientRect (hwnd, &crect);
GetWindowRect (hwnd, &wrect);
borderwidth = ((wrect.right - wrect.left) - (crect.right - crect.left))/2;
tlc.x = wrect.left + borderwidth;
tlc.y = wrect.bottom - (crect.bottom - crect.top + borderwidth);
Why MS can't give a routine that tells you the position relative to 0,0 is beyond me. It has been like this since Windows 2.1 (circa 1988).