[comp.windows.ms.programmer] Help with Dialog Boxes

dsb@mbunix.mitre.org (06/12/91)

Given that I can get the rect of the client area of a variable sized parent
window.

Is it possible to create a modeless dialog box and RfitS the dialog box to the
parentUs client area ? I would like to do this before I call DialogBox() or
immediately afterwards.

Is it possible to change the size of a dialog box from an .rc file at all ? 

Thanks in advance
Scott

Scott Blodgett			             The MITRE Corporation
dsb@mbunix.mitre.org 	        Communications Control Engineering
Burlington Road, M/S G220	    Bedford, MA 01730
(617) 271 - 8740       
RMake it in Massachusetts, Spend it in New HampshireS               

arf@world.std.com (alan feuer) (06/13/91)

In article <1991Jun11.172122.24210@linus.mitre.org> dsb@mbunix.mitre.org writes:
> ...
> Is it possible to change the size of a dialog box from an .rc file at all?
>

Try MoveWindow in WM_INITDIALOG.

/alan feuer

bonneau@hyper.hyper.com (Paul Bonneau) (06/14/91)

In article <1991Jun11.172122.24210@linus.mitre.org> dsb@mbunix.mitre.org writes:
>Given that I can get the rect of the client area of a variable sized parent
>window.
>
>Is it possible to create a modeless dialog box and RfitS the dialog box to the
>parentUs client area ? I would like to do this before I call DialogBox() or
>immediately afterwards.
>
>Is it possible to change the size of a dialog box from an .rc file at all ? 
>
A dialog box is really just a popup window.  So you can
change its size no problem--MoveWindow() or SetWindowPos()
work just fine.  The WM_INITDIALOG case is a good time to do
this.

However, if you are shrinking the dialog from its defined
size in the resource file, you will likely end up clipping
some controls (child windows of the dialog).  So be prepared
to start resizing controls as well.  This is not always easy
either, since some controls will have a minimum size, for
example a PushButton will not look nice if it is made too
small to fit its title.

cheers - Paul Bonneau.