forked from arkane-systems/mousejiggler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
63 lines (53 loc) · 2.08 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#region header
// MouseJiggle - Program.cs
//
// Alistair J. R. Young
// Arkane Systems
//
// Copyright Arkane Systems 2012-2013.
//
// Created: 2013-08-24 12:41 PM
#endregion
using System;
using System.Threading;
using System.Windows.Forms;
namespace ArkaneSystems.MouseJiggle
{
internal static class Program
{
public static bool StartJiggling = false;
public static bool ZenJiggling = false;
public static bool StartMinimized = false;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main (string[] args)
{
Mutex instance = new Mutex(false, "single instance: ArkaneSystems.MouseJiggle");
if (instance.WaitOne(0, false))
{
// Check for command-line switches.
foreach (string arg in args)
{
if ((System.String.Compare (arg.ToUpperInvariant (), "--JIGGLE", System.StringComparison.Ordinal) ==
0) ||
(System.String.Compare (arg.ToUpperInvariant (), "-J", System.StringComparison.Ordinal) == 0))
StartJiggling = true;
if ((System.String.Compare (arg.ToUpperInvariant (), "--ZEN", System.StringComparison.Ordinal) == 0) ||
(System.String.Compare (arg.ToUpperInvariant (), "-Z", System.StringComparison.Ordinal) == 0))
ZenJiggling = true;
if (
(System.String.Compare (arg.ToUpperInvariant (), "--MINIMIZED", System.StringComparison.Ordinal) ==
0) ||
(System.String.Compare (arg.ToUpperInvariant (), "-M", System.StringComparison.Ordinal) == 0))
StartMinimized = true;
}
Application.EnableVisualStyles ();
Application.SetCompatibleTextRenderingDefault (false);
Application.Run (new MainForm ());
}
instance.Close ();
}
}
}