-
Notifications
You must be signed in to change notification settings - Fork 1
/
Program.cs
42 lines (39 loc) · 1.27 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
36
37
38
39
40
41
42
using System;
using System.Runtime.InteropServices;
namespace eft_dma_radar
{
internal static class Program
{
private static Mutex _mutex;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Console.OutputEncoding = System.Text.Encoding.Unicode; // allow russian chars
try
{
_mutex = new Mutex(true, "9A19103F-16F7-4668-BE54-9A1E7A4F7556", out bool singleton);
if (singleton)
{
TarkovMarketManager.UpdateMarketItems();
ApplicationConfiguration.Initialize();
Application.Run(new MainForm());
}
else
{
throw new Exception("The Application Is Already Running!");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "EFT Radar", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
}
}