How do I prevent ragequitting?

Although I think there’s a way to handle this already somewhere, I can’t seem to find it right now… but one way would be to intercept the WM_QUIT and WM_CLOSE window messages using this How can i add window message? - #12 by gmpreussner_1