Widow

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 18  →  ?path2? @ 19
/trunk/Widow/Program.cs
@@ -1,4 +1,5 @@
using System;
using System.Threading;
using System.Windows.Forms;
 
namespace Widow
@@ -7,6 +8,8 @@
{
#region Static Fields and Constants
 
private static readonly Mutex Mutex = new Mutex(true, Constants.AssemblyGuid);
 
private static Form _form;
 
#endregion
@@ -29,10 +32,21 @@
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
_form = new MainForm();
Application.Run();
if (Mutex.WaitOne(TimeSpan.Zero, true))
{
Application.SetCompatibleTextRenderingDefault(false);
_form = new MainForm();
Application.Run();
Mutex.ReleaseMutex();
return;
}
 
// Foreground current other application window.
Natives.PostMessage(
(IntPtr) Natives.HWND_BROADCAST,
Natives.WM_SHOWME,
IntPtr.Zero,
IntPtr.Zero);
}
 
#endregion