Since there is no such function, then this is a BUG!
Seriously, there are times when it is very necessary to prohibit the closing of the window. A person enters some information, accidentally pokes somewhere and that’s it, the window is closed.
Or, tell me how to do it programmatically, I will be very grateful
This problem has been around for who knows how long.