public static void SetErrorRestart()
 {
     //设置程序的异常处理
     filter = new UnhandledExceptionFilter(MyUnhandledExceptionFilter);
     SetUnhandledExceptionFilter(filter);
     Application.SetUnhandledExceptionMode(UnhandledExceptionMode.ThrowException);
     SetErrorMode(SEM_FAILCRITICALERRORS + SEM_NOOPENFILEERRORBOX + SEM_NOGPFAULTERRORBOX);
 }
Exemple #2
0
 private static extern Int32 SetUnhandledExceptionFilter(UnhandledExceptionFilter fun);
 private static extern IntPtr SetUnhandledExceptionFilter(UnhandledExceptionFilter filter);