|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;
using System.Text;
namespace GmailForWin7
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
// See if this is the first instance
bool firstInstance = false;
using (Mutex appMutex = new Mutex(true, "GmailForWin7", out firstInstance))
{
if (firstInstance)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new GmailMain());
}
else
{
// Send argument to running window
HandleCmdLineArgs(args);
}
}
}
public static void HandleCmdLineArgs(string[] args)
{
if (args.Length >= 1)
{
switch (args[0])
{
case "CheckNow":
WindowsMessageHelper.SendMessage(GmailMain.FormTitle, WindowsMessageHelper.CheckNowMsgId);
break;
case "Settings":
WindowsMessageHelper.SendMessage(GmailMain.FormTitle, WindowsMessageHelper.ShowSettingsMsgId);
break;
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been developing .NET applications since 2001 and have been working in software development since 1989.