-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathProgram.cs
32 lines (29 loc) · 1.02 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
using System;
using System.Collections.Generic;
using System.Threading;
using System.Windows.Forms;
using tb_vol_scroll.Classes;
namespace tb_vol_scroll
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Globals.AppArgs = new List<string>(args);
Globals.AppMutex = new Mutex(true, @"Global\" + Application.ProductName, out bool didCreate);
if (!Globals.AppMutex.WaitOne(0, false) || !didCreate)
{
MessageBox.Show("Another instance is already running.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
Environment.Exit(1);
}
GC.KeepAlive(Globals.AppMutex);
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}