--- trunk/TSAdminTool/Program.cs 2012/07/12 18:56:31 64 +++ trunk/TSAdminTool/Program.cs 2012/07/12 19:07:58 65 @@ -17,11 +17,16 @@ namespace AnywhereTS AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException, true); + Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmAdmin()); } + static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e) + { + CurrentDomain_UnhandledException(sender, new UnhandledExceptionEventArgs(e.Exception, false)); + } static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs args) { Exception e = (Exception)args.ExceptionObject; |