简体   繁体   中英

multiple top-level windows

A single threaded Win32 GUI application has multiple top-level windows. In a message handler for one of the windows, it displays a modal dialog (for example, by using the MessageBox function). The other windows in the application still work as usual, even though the only thread in the application is waiting for the modal dialog result.

how does this behavior work?

A modal dialog is a dialog which disables it's owner and enters a message loop until it is closed. When it is closed, the calling function receives the dialog result code, and execution returns to the thread message loop (or the previous modal dialog).

Since it is executing a message loop, other windows in the thread will continue to receive messages.

Ie the other windows continue to work because the modal dialog is dispatching their messges.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM