By default in Windows Vista, 7 and upwards, when an application crashes, Windows pops up the common Application Debug Close popup window an example of which is shown below:
Sometimes this can be a problem specially if you are running automated tests and you do not want to have to manually press any keys or if you just want your application to crash without this popup window.
The best way to do that is to use Gepedit.msc.
- Go to Start. Type gpedit.msc
- Navigate to Computer Configuration->Administrative Templates->Windows Components->Windows Error Reporting
- On the right pane, click on “Prevent display of the user interface for critical errors” and set it to Enabled.
This will disable the popup from showing up.