
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