-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathProgram.cs
30 lines (26 loc) · 946 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ImageEnhancingUtility.Winforms
{
static class Program
{
[STAThread]
static void Main()
{
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainFormDark());
}
static void MyHandler(object sender, UnhandledExceptionEventArgs args)
{
Exception e = (Exception)args.ExceptionObject;
MessageBox.Show("MyHandler caught : " + e.Message + $"\n{e.InnerException?.Message}");
//MessageBox.Show($"Runtime terminating: {args.IsTerminating}");
}
}
}