Modal dialogs with native title bar


It seems that the native title bar recieves messages although there is a modal dialog box on top. If I click the “Close” button, then exit the dialog, then the whole application closes…


That doesn’t seem to happen in the juce demo… Any clues about how I could reproduce it?


Use AlertWindow::showNativeDialogBox as the modal dialog


How about just tweaking juce_win32_Windowing.cpp:

case WM_CLOSE: if (! component->isCurrentlyBlockedByAnotherModalComponent()) handleUserClosingWindow(); return 0;


Yup! That works. Also:

              case WM_SYSCOMMAND:
						if (component->isCurrentlyBlockedByAnotherModalComponent() )
							return 0;

						switch (wParam & 0xfff0)
						case SC_CLOSE:
							if (hasTitleBar())
								PostMessage (h, WM_CLOSE, 0, 0);

does the trick.

Thanks Jules!