On my AHMI project I have a main form with buttons to open 2 other forms. If the user closes either of these 2 forms by accidently using the red 'X' button in the top right hand corner of the window the program terminates and hangs. It can only be started up again by terminating the program process in the windows task manager.
Does anyone know if there is a method of avoiding premature program termination e.g. I would like to terminate the program from the main form only. I would also like to ensure the program terminates leaving the software inputs (diagnostic & control) in a known pre-defined state