Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-01-16 13:24:26 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-01-16 13:24:26 +0300
commit2e07a79d4ddd78bc0ac06bf87c9e86979cce414b (patch)
tree0bef97808cf9c020e33e655ae6d6e2bddc4407a6 /Program.cs
parent10de3c40654d71a58095ff900567a8e592e2a738 (diff)
Code cleanup
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs92
1 files changed, 45 insertions, 47 deletions
diff --git a/Program.cs b/Program.cs
index d25745a6..594d8542 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,47 +1,45 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Threading;
-using System.Windows.Forms;
-
-namespace com.clusterrr.hakchi_gui
-{
- static class Program
- {
- [DllImport("user32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- static extern bool SetForegroundWindow(IntPtr hWnd);
-
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- bool createdNew = true;
- using (Mutex mutex = new Mutex(true, "hakchi2", out createdNew))
- {
- if (createdNew)
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new MainForm());
- }
- else
- {
- Process current = Process.GetCurrentProcess();
- foreach (Process process in Process.GetProcessesByName(current.ProcessName))
- {
- if (process.Id != current.Id)
- {
- SetForegroundWindow(process.MainWindowHandle);
- break;
- }
- }
- }
- }
- }
- }
-}
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Threading;
+using System.Windows.Forms;
+
+namespace com.clusterrr.hakchi_gui
+{
+ static class Program
+ {
+ [DllImport("user32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool SetForegroundWindow(IntPtr hWnd);
+
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ bool createdNew = true;
+ using (Mutex mutex = new Mutex(true, "hakchi2", out createdNew))
+ {
+ if (createdNew)
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+ else
+ {
+ Process current = Process.GetCurrentProcess();
+ foreach (Process process in Process.GetProcessesByName(current.ProcessName))
+ {
+ if (process.Id != current.Id)
+ {
+ SetForegroundWindow(process.MainWindowHandle);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}