Hi

The even´t on close will trigger when the windows is already closing.
The action off closing can´t be stoped.
Now you can always open i again when closing it.

Note: I don´t know if is ther any other command that can prevent a window to close.