What functions are called when the user closes a standalone window?

When the user closes the standalone window using Alt-F4 or the 'X' button, what functions are called?

OnApplicationQuit follwed by OnDisable