Winify – Blame information for rev 28
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System; |
2 | using System.Threading; |
||
3 | using System.Windows.Forms; |
||
8 | office | 4 | using Winify.Utilities; |
1 | office | 5 | |
6 | namespace Winify |
||
7 | { |
||
8 | internal class Program : IDisposable |
||
9 | { |
||
10 | #region Constructors, Destructors and Finalizers |
||
11 | |||
12 | public void Dispose() |
||
13 | { |
||
14 | _form?.Dispose(); |
||
15 | _form = null; |
||
16 | } |
||
17 | |||
18 | #endregion |
||
19 | |||
20 | #region Private Methods |
||
21 | |||
22 | /// <summary> |
||
23 | /// The main entry point for the application. |
||
24 | /// </summary> |
||
25 | [STAThread] |
||
26 | private static void Main() |
||
27 | { |
||
28 | if (Mutex.WaitOne(TimeSpan.Zero, true)) |
||
29 | { |
||
30 | Application.EnableVisualStyles(); |
||
31 | Application.SetCompatibleTextRenderingDefault(false); |
||
19 | office | 32 | _form = new Form1(Mutex); |
1 | office | 33 | Application.Run(); |
34 | Mutex.ReleaseMutex(); |
||
35 | return; |
||
36 | } |
||
37 | |||
38 | // Foreground current other application window. |
||
39 | Natives.PostMessage( |
||
28 | office | 40 | (IntPtr)Natives.HWND_BROADCAST, |
1 | office | 41 | Natives.WM_SHOWME, |
42 | IntPtr.Zero, |
||
43 | IntPtr.Zero); |
||
44 | } |
||
45 | |||
46 | #endregion |
||
28 | office | 47 | |
48 | #region Static Fields and Constants |
||
49 | |||
50 | private static readonly Mutex Mutex = new Mutex(true, Constants.AssemblyGuid); |
||
51 | |||
52 | private static Form _form; |
||
53 | |||
54 | #endregion |
||
1 | office | 55 | } |
56 | } |