demonplus
demonplus

Reputation: 5801

Modal dialog becomes non-modal

I have MFC SDI application, in it modal dialog is displayed. During that second dialog can be displayed, which is also modal. Second dialog is doing some job and auto-closed by

dlg->PostMessage(WM_CLOSE);

All that works but after second dialog is closed first dialog is not modal any more, this means I can click the main window of the application.

Any ideas how this can be solved?

Upvotes: 0

Views: 312

Answers (1)

Cheers and hth. - Alf
Cheers and hth. - Alf

Reputation: 145279

A window can only handle one modal dialog at a time.

Therefore, specify the first dialog as parent for the second.

Upvotes: 3

Related Questions