If the dialog has an owner window, that window is disabled. This means that all user input to the owner, and its descendants, is prevented.
This function then dispatches messages from the queue to the appropriate window or dialog procedure until the dialog is dismissed by WinDismissDlg. This is usually done by the dialog procedure on receipt of an appropriate message, but also occurs if the dialog procedure passes a WM_COMMAND message to WinDefDlgProc or if the WM_QUIT message is encountered before the dialog window is dismissed. In this latter case, WinProcessDlg itself issues WinDismissDlg, and posts the WM_QUIT message back to the queue so that the application main loop terminates in the normal way.
This function shows the window, if it is hidden, when the queue is empty. It is therefore possible for the experienced user to type ahead and cause the dialog to be dismissed before it becomes visible.
If the dialog window needs to be processed through WinProcessDlg, after being dismissed, the FF_DLGDISMISSED flag must be reset.
WinDismissDlg hides the dialog window without destroying it, and also re-enables any window that was disabled by this function.
This function does not return until a WinDismissDlg call is issued in one of the ways listed above. This is true even if the application main window has not been disabled, for example because the dialog window has no owner. In this case, the dialog will appear to the user to be modeless; the user will continue to be able to interact with the application, and possibly create multiple instances of the dialog. In such circumstances the operating system calls the application main window procedure recursively before WinProcessDlg returns.
It is not possible to temporarily disable more than one window using this function; a dialog window can have at most one owner. If an application has more than one main window which should be disabled while the modal dialog is displayed, it can be done by setting appropriate hooks using WinSetHook.
If the dialog window is a descendant of its owner, this function disables input to the dialog itself. However, this situation can only occur by explicitly changing the window hierarchy. Dialog windows are created using WinLoadDlg or WinCreateDlg, which modify the owner window specified on their parameter lists.