Disable “application has stopped working” window

泪湿孤枕 提交于 2019-12-03 15:44:23

I know this is an old question, but I was having the same problem and found a solution.

Call the following at the start of your application:

SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX );

I've tried it with a very simple test application that attempts to dereference a null pointer. Without the line above, my test application would show "... has stopped working dialog." With the line above, the application just dies quietly.

References:

EDIT: Here's an option for disabling that dialog system-wide without modifying code. Create the following registry value as a REG_DWORD and set the value to 1:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\DontShowUI

Reference: WER Settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!