Try setting the registry following registry value to value DWORD 2:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlWindowsErrorMode = 2
This will affect every process on the machine.
Reference:
How to Get Rid of System and Application Popup Messages
If you have the source code to the program that crashes, you can prevent the popups by catching all structured exceptions and exiting without popping up a message box. How you do this depends on the programming language used.
If you don't have the source, use the SetErrorMode function in the parent to suppress popups. The error mode is inherited by subprocesses. You must set UseShellExecute to false for this to work:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace SubProcessPopupError
{
class Program
{
[DllImport("kernel32.dll", SetLastError = true)]
static extern int SetErrorMode(int wMode);
static void Main(string[] args)
{
int oldMode = SetErrorMode(3);
Process p;
ProcessStartInfo ps = new ProcessStartInfo("crash.exe");
ps.UseShellExecute = false;
p = Process.Start(ps);
SetErrorMode(oldMode);
p.WaitForExit();
}
}
}
If you are getting a dialog saying "Do you want to debug using the selected debugger?", you can turn that off by setting this registry value to 0.
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionAeDebugAuto = 0
However, I don't think this will come up if you have set the error mode to 3 as explained above.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…