Files
i2p 773d05f8f1
Pulsar .NET 9.0 Windows Release / build (push) Waiting to run
Mirror to Codeberg and Gitea / mirror (push) Waiting to run
initial commit
2026-08-27 10:57:58 -06:00

47 lines
1.4 KiB
C#

using Pulsar.Client.Config;
using Pulsar.Client.IO;
using System;
using System.Diagnostics;
using System.Net;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
namespace Pulsar.Client
{
internal static class Program
{
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr GetThreadDesktop(uint dwThreadId);
[DllImport("kernel32.dll")]
private static extern uint GetCurrentThreadId();
[DllImport("user32.dll", SetLastError = true)]
private static extern bool SetProcessDPIAware();
[STAThread]
private static void Main()
{
// enable TLS 1.2
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
SetProcessDPIAware();
// Set the unhandled exception mode to force all Windows Forms errors to go through our handler
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
SaveOriginalDesktop();
Application.Run(new PulsarApplication());
}
private static void SaveOriginalDesktop()
{
Settings.OriginalDesktopPointer = GetThreadDesktop(GetCurrentThreadId());
}
}
}