You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Threading; |
|
using System.Threading.Tasks; |
|
using System.Windows.Forms; |
|
|
|
namespace LunaWin |
|
{ |
|
static class Program |
|
{ |
|
/// <summary> |
|
/// application guid |
|
/// </summary> |
|
static Mutex mutex = new Mutex(true, "{4e497175-ad4e-4974-8201-4c876ae69985}"); |
|
|
|
/// <summary> |
|
/// The main entry point for the application. |
|
/// </summary> |
|
[STAThread] |
|
static void Main() |
|
{ |
|
if(mutex.WaitOne(TimeSpan.Zero,true)) |
|
{ |
|
Application.EnableVisualStyles(); |
|
Application.SetCompatibleTextRenderingDefault(false); |
|
|
|
// set up the hidden form for handling window messaging events |
|
LunaHidden lunaHidden = new LunaHidden(); |
|
lunaHidden.Show(); |
|
|
|
// set up the about window |
|
Globals.lunaForm = new LunaForm(); |
|
|
|
// get current startup preference |
|
LunaMenu lm = new LunaMenu(); |
|
lm.GetStartup(); |
|
|
|
// invoke the icon display method |
|
using (LunaIcon lunaIcon = new LunaIcon()) |
|
{ |
|
lunaIcon.Display(); |
|
|
|
Application.Run(); |
|
|
|
//Application.Run(); |
|
} |
|
} else |
|
{ |
|
MessageBox.Show("LunaWin is already running."); |
|
Application.Exit(); |
|
} |
|
} |
|
} |
|
} |