How the Non-Web Recovery System Closes Windows

The built-in recovery system restores the base state by making sure that the non-Web application is running, is not minimized, is active, and has no open windows except for the main window. To ensure that only the main window is open, the recovery system attempts to close all other open windows, using an internal procedure that you can customize as you see fit.

To make sure that there are no application windows open except the main window, the recovery system calls the built-in CloseWindows method. This method starts with the currently active window and attempts to close it using the sequence of steps below, stopping when the window closes.

  1. If a Close method is defined for the window, call it.
  2. Click the Close menu item on the system menu, on platforms and windows that have system menus.
  3. Click the window’s close box, if one exists.
  4. If the window is a dialog box, type each of the keys specified by the OPT_ CLOSE_DIALOG_KEYS option and wait one second for the dialog box to close. By default, this option specifies the Esc key.
  5. If there is a single button in the window, click that button.
  6. Click each of the buttons specified by the OPT_CLOSE_WINDOW_ BUTTONS option. By default, this option specifies the Cancel, Close, Exit, and Done keys.
  7. Select each of the menu items specified by the OPT_CLOSE_WINDOW_ MENUS option. By default, this option specifies the File > Exit and the File > Quit menu items.
  8. If the closing of a window causes a confirmation dialog box to open, CloseWindows attempts to close the dialog box by clicking each of the buttons specified with the OPT_CLOSE_CONFIRM_BUTTONS option. By default, this option specifies the No button.

When the window, and any resulting confirmation dialog box, closes, CloseWindows repeats the preceding sequence of steps with the next window, until all windows are closed.

If any of the steps fails, none of the following steps is executed and the recovery system raises an exception. You may specify new window closing procedures.

In a Web application, you are usually loading new pages into the same browser, not closing a page before opening a new one.