30 lines
863 B
C#
30 lines
863 B
C#
using System;
|
|
using System.Reflection;
|
|
using System.Runtime.InteropServices;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
|
|
namespace ScreenCapture
|
|
{
|
|
static class Program
|
|
{
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
Assembly assembly = Assembly.GetExecutingAssembly();
|
|
|
|
Mutex mutex = new Mutex(true, ((GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0]).Value);
|
|
|
|
if (mutex.WaitOne(TimeSpan.Zero, true))
|
|
{
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new MainForm(assembly.Location));
|
|
mutex.ReleaseMutex();
|
|
}
|
|
}
|
|
}
|
|
}
|