|
|
|
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
|
|
|
|
{
|
|
|
|
Application.Exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|