Winify – Rev 12
?pathlinks?
using System;
using System.Threading;
using System.Windows.Forms;
using Winify.Utilities;
namespace Winify
{
internal class Program : IDisposable
{
#region Static Fields and Constants
private static readonly Mutex Mutex = new Mutex(true, Constants.AssemblyGuid);
private static Form _form;
#endregion
#region Constructors, Destructors and Finalizers
public void Dispose()
{
_form?.Dispose();
_form = null;
}
#endregion
#region Private Methods
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
if (Mutex.WaitOne(TimeSpan.Zero, true))
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
_form = new Form1();
Application.Run();
Mutex.ReleaseMutex();
return;
}
// Foreground current other application window.
Natives.PostMessage(
(IntPtr) Natives.HWND_BROADCAST,
Natives.WM_SHOWME,
IntPtr.Zero,
IntPtr.Zero);
}
#endregion
}
}
Generated by GNU Enscript 1.6.5.90.