When I minimze form while running in Visual Studio, everything works fine - form is hidden and restored to previous FormWindowState.
However, when running outside of the IDE, suddenly form starts closing. I attached to running process, however I wasn't able to determine cause of this.
Edit: Cancelling form closing within FormClosing event doesn't even prevent form from closing when I minimalize form.
Update: It seems that hiding form causes closing it. Beacuse, if I don't hide form when user minimizes it, it won't close.
This is much more weird, since in IDE it works as expected.