This repository was archived by the owner on Sep 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
50 lines (45 loc) · 1.36 KB
/
Copy pathProgram.cs
File metadata and controls
50 lines (45 loc) · 1.36 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using Microsoft.Win32;
using MyGui.net.Properties;
namespace MyGui.net
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
string _DefaultOpenedDir = "";
if (args.Length > 0)
{
_DefaultOpenedDir = args[0];
}
if (!Settings.Default.use9xTheme)
{
ApplicationConfiguration.Initialize();
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
Application.SetColorMode((SystemColorMode)Settings.Default.Theme);
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"))
{
object value = key?.GetValue("AppsUseLightTheme");
if (value is int intValue)
{
Util.IsSystemDarkMode = intValue == 0;
}
}
}
Application.AddMessageFilter(new AccessibleDescriptionTooltipFilter());
try
{
Application.Run(new Form1(_DefaultOpenedDir));
}
catch (Exception)
{
return; //close if running the form fails
}
}
}
}