Add close-window procedure.