-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
35 lines (32 loc) · 1011 Bytes
/
Program.cs
File metadata and controls
35 lines (32 loc) · 1011 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
using System;
using System.Threading;
using System.Windows.Forms;
namespace iRacingModeSwitcher
{
static class Program
{
[STAThread]
static void Main()
{
bool createdNew;
using (Mutex mutex = new Mutex(true, "iRacingModeSwitcherMutex", out createdNew))
{
if (!createdNew)
{
MessageBox.Show(
"iRacing Mode Switcher is already running.",
"Instance Detected",
MessageBoxButtons.OK,
MessageBoxIcon.Warning
);
return;
}
// Enables modern visual styles and sets up rendering
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Launches the main form (your GUI)
Application.Run(new Form1());
}
}
}
}