We have a dialog X
, that can be opened by different threads (also main thread) as modal. Multiple modal X
dialogs, at the same time from different threads is possible.
We want to close all X
(only X
) modal dialogs, if the main window handles a SC_CLOSE
message.
The question is; From the main window, how can we close all modal X
dialogs, when it recieves the SC_CLOSE
message? Only X
! So, PostQuitMessage
doesn't help, because it closes whole app, we don't want to close the app, if other modal dialogs like Y, Z ...
are opened.
Info: Main window can handle SC_CLOSE
message, when we have the opened modal X
dialog from main thread also from other threads. And X
has no child modal window.
X
-dialog. – Yusuf R. KaragözX
-dialogs can be registered in a static global collection in a thread-safe way, then can i close those dialogs? – Yusuf R. KaragözWM_CLOSE
is the message sent when you click the Close button, notSC_CLOSE
. And you can send it yourself too. Of course, because you have a multithreaded setup, I'm not sure what would happen if you were to tell the messagebox to close at any given point... – andlabs