Show the dialog modally: disable the parent window, pump messages through the dialog manager until endModal is called (or the dialog is closed), then re-enable the parent and return the result.
See Implementation
Show the dialog modally: disable the parent window, pump messages through the dialog manager until endModal is called (or the dialog is closed), then re-enable the parent and return the result.