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 18:43:38 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-01-16 18:43:38 +0300
commit2623e972f7f2b2568e66a2b596272668aafd1c9d (patch)
tree567f2b836b0518b988cc8081d216d7869a181e08 /Program.cs
parent2e07a79d4ddd78bc0ac06bf87c9e86979cce414b (diff)
Many debug info for problem users
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index 594d8542..d39f96b4 100644
--- a/Program.cs
+++ b/Program.cs
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
+using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
@@ -11,6 +12,9 @@ namespace com.clusterrr.hakchi_gui
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool SetForegroundWindow(IntPtr hWnd);
+ [DllImport("kernel32.dll", SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool AllocConsole();
/// <summary>
/// The main entry point for the application.
@@ -18,14 +22,23 @@ namespace com.clusterrr.hakchi_gui
[STAThread]
static void Main()
{
+#if DEBUG
+ AllocConsole();
+ Stream logFile = File.Create("debuglog.txt");
+ Debug.Listeners.Add(new TextWriterTraceListener(logFile));
+ Debug.Listeners.Add(new TextWriterTraceListener(System.Console.Out));
+ Debug.AutoFlush = true;
+#endif
bool createdNew = true;
using (Mutex mutex = new Mutex(true, "hakchi2", out createdNew))
{
if (createdNew)
{
+ Debug.WriteLine("Starting...");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
+ Debug.WriteLine("Done.");
}
else
{