forked from ThioJoe/F-Key-Sender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
35 lines (32 loc) · 1.32 KB
/
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
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Configuration;
namespace F_Key_Sender
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// -------- This code seems to be needed to actually get it to work with high DPI awareness even after adding app.manifest and app.config stuff --------
// Also need to add reference to System.Configuration as dependency by right clicking Project > Add > Reference > Search: System.Configuration
var section = ConfigurationManager.GetSection("System.Windows.Forms.ApplicationConfigurationSection") as NameValueCollection;
if (section != null)
{
section["DpiAwareness"] = "PerMonitorV2";
}
//------------------------------------------------------------------------------------------------------------------------------------------------------
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}