Showing common dialogs modeless??? 
Author Message
 Showing common dialogs modeless???

Hi

Is it possible to show any of the common dialogs as modeless dialogs
rather than as modal dialogs?

The object is to have common dialogs as Propery Pages (mainly the Page
Setup Dialog).

Phil



Fri, 21 Jul 2000 03:00:00 GMT  
 Showing common dialogs modeless???

Quote:

>Hi

>Is it possible to show any of the common dialogs as modeless dialogs
>rather than as modal dialogs?

>The object is to have common dialogs as Propery Pages (mainly the Page
>Setup Dialog).

Not with an API call, I think. The dialog templates are included with VC++,
though (in the VC\include directory, as *.dlg files), so you can use them to
make your modeless dialogs. The DlgProc for them must be buried somewhere in
CommDlg.dll, but it probably wouldn't be suitable for use as the DlgProc for a
property sheet, so you may have to do your own anyway.

Pete Barrett



Sat, 22 Jul 2000 03:00:00 GMT  
 Showing common dialogs modeless???

If I were faced with this, what I'd do is subclass the common dialog,
and do the following:
        Change the IDOK button to say "Close"
        Hide the IDCANCEL button
        Add an "Apply" button
        Add an OnCancel method that called DestroyWindow,
        or did nothing (depends on what you want Escape to do)
        Add an OnOK method that called DestroyWindow
        Use Create instead of DoModal
        Note that neither OnOK or OnCancel should call the superclass

        Alternative: Change IDOK caption to "Apply"
                           Change IDCANCEL caption to "Close"
                      OnOK handler calls DoDataExchange()
                      (I never remember if the parameter is FALSE
                      or TRUE, one of the dumber interfaces ever
                      designed)
                      OnOK handler does NOT call superclass OnOK
                      OnCancel handler calls DestroyWindow
                      (this means Escape also closes the window)

        Note that you should do a SendMessage/PostMessage when
        you want your app to note the new parameters.  This should be
        preceded by the DoDataExchange call that forces the control
        values back into the member variables (or if you don't like
        DDX, by whatever code causes the values to update to match
        the controls).  In the case of the common dialogs, you may
        have to experiment to see if you have to "roll your own"
        DDX-equivalent or if DoDataExchange will do the right update
        for you.

        Good luck.
                                        joe


Quote:


>>Hi

>>Is it possible to show any of the common dialogs as modeless dialogs
>>rather than as modal dialogs?

>>The object is to have common dialogs as Propery Pages (mainly the Page
>>Setup Dialog).

>Not with an API call, I think. The dialog templates are included with VC++,
>though (in the VC\include directory, as *.dlg files), so you can use them to
>make your modeless dialogs. The DlgProc for them must be buried somewhere in
>CommDlg.dll, but it probably wouldn't be suitable for use as the DlgProc for a
>property sheet, so you may have to do your own anyway.

>Pete Barrett

Joseph M. Newcomer

http://www3.pgh.net/~newcomer


Mon, 24 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. App fails when creating/showing Modeless Dialog

2. Modal vs. Modeless dialog and controls not showing

3. Modeless dialogs in dlls showing help

4. modeless dialog not showing

5. Showing a modeless progress dialog while opening document with MFC

6. App fails when creating/showing Modeless Dialog

7. Showing icon in taskbar for a modeless dialog.

8. Help me in showing a dialog immediately when main dialog shows

9. Modeless dialog shall not be modeless !

10. Q: tabbing not possible in modeless propertysheet / modeless dialog

11. Modeless property sheet in a modeless dialog box

12. Cannot display the dialog derived from common file dialog

 

 
Powered by phpBB® Forum Software