[comp.windows.ms.programmer] Dialog Boxes as main window

johnc@plxsun.uucp (John Ciccarelli) (01/24/91)

In article <11395@darkstar.ucsc.edu> hall@ucscb.ucsc.edu (60265000) writes:
>
>I was wondering if there was a way to make a dialog box the main
>window of a program and be able to minimize the dialog box into an icon.
>Christopher Hall

You can achieve a similar effect by:

a) designing the dialog without WS_BORDER (so it has no border)
b) opening it as a WS_CHILD of the app window, at (0,0) in client coords

The dialog will cover the app's client area, just as if you had 
placed controls directly on the app client area.  Since the
dialog is a WS_CHILD of the app, it does the right thing when the app is
minimized.  This only works for modeless (CreateDialog) dialogs, not 
for modal (DialogBox) dialogs, because of Windows' modality logic.

NOTE: I'm not sure if you can put WS_CHILD directly in the STYLE line
that follows the DIALOG in the RC file; the examples usually use WS_POPUP.
If that doesn't work, open the dialog with CreateDialogIndirect instead
of CreateDialog, and modify the style before showing the dialog.  (The 
implementation of the OPEN FORM statement in Plexus' Windows 4GL language 
always uses CreateDialogIndirect, so I honestly don't know how to do it 
via the RC file, at least off the top of my head.)

John Ciccarelli
Plexus Software, 5200 Great America Pkwy, Suite 200, Santa Clara CA 95054
email: ...sun!plx!johnc,  voice: 408-982-4842,  fax: 408-727-4864