Implemented window close/open.