-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
38 lines (31 loc) · 1004 Bytes
/
Program.cs
File metadata and controls
38 lines (31 loc) · 1004 Bytes
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
using System;
using System.Runtime.InteropServices;
namespace lifeviz;
public static class Program
{
[STAThread]
public static void Main(string[] args)
{
// Enable Per-Monitor V2 DPI Awareness before any WPF code runs
NativeMethods.SetProcessDpiAwarenessContext(NativeMethods.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
if (SmokeTestRunner.TryRun(args, out int exitCode))
{
Environment.ExitCode = exitCode;
return;
}
if (DiagnosticTestRunner.TryRun(args, out exitCode))
{
Environment.ExitCode = exitCode;
return;
}
var app = new App();
app.InitializeComponent();
app.Run();
}
private static class NativeMethods
{
public static readonly IntPtr DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = (IntPtr)(-4);
[DllImport("user32.dll")]
public static extern bool SetProcessDpiAwarenessContext(IntPtr dpiContext);
}
}