Closes the window, and returns an optional integer value used by the ShowModal method.
Referenced by: