Hi Alexander Ekzarov,
We don#%92t have an option called hold the event of when we are trying to close the InfoPath form using close button in tool bar. If you want catch the event when the form is closing, you have to keep one button in the form and write code for that one.