TO:    All PG+ Users
FROM:  ProtoView Development Corp.

Here is a new, simple dialog manipulation application.  There are two fancy 
but simple dialog manipulation done here that are explained below.  The first 
example:

The idea is to have one dialog disappear when a second one is created.  The 
problem is that whenever a dialog is destroyed, all its children are also 
destroyed.  To get around this, we need to call the second dialog with its 
parent as the main window, not the calling dialog.  To duplicate, perform 
the following steps:

1) Declare the variable

        HWND hMain;

in the main application header file.  This makes the variable global.

2)  In the main application .c file, set the following command

        hMain=hWndMain;

to store the main windows handle globally.

3)  In the dialog first.c, alter the following code in the button click
message from:

        if ( fnSecond(hWnd,0,NULL) )
        {
        }

to:

        if ( fnSecond(hMain,0,NULL) )
        {
        }

This makes the Second dialogs parent the main window (hMain) and not the
First dialog (hWnd).  This means that when the First dialog is destroyed,
all its children will be destroyed, but the Second dialog isn't one of its
children.

4)  You need to

        //lock

this segment of code for it to remain permanent.

5)  Finally, you need to destroy the First dialog with a Windows function
call

        DestroyWindow(hWnd);

in the button clicked message case.  This sends a WM_DESTROY to the First
dialog and !poof! one dialog is gone and the Second is there.

**********************************************************************

The second example involving a Third dialog is very basic, but effective.  It
uses a growing dialog that displays certain controls only when needed rather
than cluttering the dialog with often ignored controls.  It makes use of only
one variable 

        int depressed;

for the status of the pvButton.  The ProtoView function call 

        vwSetViewWidth(hViewThird, x, VW_REPAINT);

is all thats needed to get it operational.


Best Regards,

ProtoView Development

