Modal windows

Up to this point, closing one dialog opened another in its place. You can also create "modal" windows that pop up on top of the current window. Instead of publishing the NewDialog event inside a button, such as with our Next button, we can publish the SpawnDialog event.

Modal windows are usually a little bit smaller in size than normal windows so that the parent window can be seen in the background. Suppose we had a dialog called PopupDlg; we could use the SpawnDialog event to open it modally. Typically, modal windows have an OK button that publishes the EndDialog event with a Value of Return. This allows them to be closed and have focus return to the parent window.

Here's what a button on InstallDlg would look like if it were set ...

Get WiX: A Developer's Guide to Windows Installer XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.