🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1128

Re: Dialog Boxes as main window

#1128
From: John Ciccarelli
Date: Wed, 23 Jan 1991 19:31
28 lines
2027 bytes
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
Technical Details
Message-ID: <2556@plx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!plx!plxsun!johnc
References: <11395@darkstar.ucsc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!plx!plxsun!johnc
From: johnc@plxsun.uucp (John Ciccarelli)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Dialog Boxes as main window
Summary: Use a borderless WS_CHILD modeless dialog at client (0,0)
Keywords: child modeless borderless dialog
Message-ID: <2556@plx.UUCP>
Date: 23 Jan 91 19:31:55 GMT
References: <11395@darkstar.ucsc.edu>
Sender: usenet@plx.UUCP
Reply-To: sun!plx!johnc (John Ciccarelli)
Followup-To: comp.windows.ms.programmer
Organization: Plexus Software, Santa Clara, CA
Lines: 28