2023-02-24 13:30:30 +00:00
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
2023-03-21 10:27:29 +01:00
|
|
|
using ManagedCommon;
|
2023-02-24 13:30:30 +00:00
|
|
|
|
|
|
|
|
namespace MouseJumpUI;
|
|
|
|
|
|
|
|
|
|
internal static class Program
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The main entry point for the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[STAThread]
|
|
|
|
|
private static void Main()
|
|
|
|
|
{
|
2023-03-21 10:27:29 +01:00
|
|
|
Logger.InitializeLogger("\\MouseJump\\Logs");
|
|
|
|
|
|
2023-02-24 13:30:30 +00:00
|
|
|
// To customize application configuration such as set high DPI settings or default font,
|
|
|
|
|
// see https://aka.ms/applicationconfiguration.
|
|
|
|
|
ApplicationConfiguration.Initialize();
|
|
|
|
|
|
|
|
|
|
if (PowerToys.GPOWrapper.GPOWrapper.GetConfiguredMouseJumpEnabledValue() == PowerToys.GPOWrapper.GpoRuleConfigured.Disabled)
|
|
|
|
|
{
|
|
|
|
|
// TODO : Log message
|
|
|
|
|
Logger.LogWarning("Tried to start with a GPO policy setting the utility to always be disabled. Please contact your systems administrator.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Application.HighDpiMode != HighDpiMode.PerMonitorV2)
|
|
|
|
|
{
|
|
|
|
|
Logger.LogError("High dpi mode is not set to PerMonitorV2.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Application.Run(new MainForm());
|
|
|
|
|
}
|
|
|
|
|
}
|