forked from fdorg/flashdevelop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
45 lines (41 loc) · 1.34 KB
/
Program.cs
File metadata and controls
45 lines (41 loc) · 1.34 KB
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
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Threading;
namespace AppMan
{
static class Program
{
/// <summary>
/// SIA Mutex entry
/// </summary>
private static Mutex mutex = new Mutex(true, "{2A46BA9B-F8DA-40AA-904F-4C1630BA4428}");
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(String[] args)
{
try
{
if (mutex.WaitOne(TimeSpan.Zero, true))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm(args));
mutex.ReleaseMutex();
}
else if (Array.IndexOf(args, "-minimized") == -1)
{
if (Win32.IsRunningOnMono) MessageBox.Show("AppMan is already running.");
else Win32.PostMessage((IntPtr)Win32.HWND_BROADCAST, Win32.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
}
}
catch (Exception ex)
{
MessageBox.Show("Error while starting AppMan:\n" + ex.ToString());
}
}
}
}