SetWindowAutoClose ( win, exit_on_close )

If exit_on_close is true then the window will close when the close button on the window is clicked.
If it is false then nothing will happen when the close button is pressed.

Note: If it is set to false you can set your own action for the close button by checking the event with WindowEvent_Close

Example: