[This is preliminary documentation and subject to change.]
The following example illustrates how to author a conditional message box that pops up and warns the user that a background task is still running whenever the user activates a displayed control prematurely.
The example also illustrates how the SpawnWaitDialog ControlEvent can in general be used to protect a control that triggers an action dependent upon the completion of a background task.
In this example, a Selection Dialog containing three pushbutton controls labeled Install Now, Next, and Disk Cost is displayed to the user during the installation process. However, the installer also carries out a disk space costing task in the background while displaying this dialog box. The author wishes to protect these buttons from activation and wants a "Please wait" message box to pop up if the user pushes any of the buttons before the costing has completed. The author also wants this message box to contain a Cancel button and to disappear as soon as the background task is finished .