-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (24 loc) · 818 Bytes
/
Copy pathProgram.cs
File metadata and controls
29 lines (24 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using GameTools.Core;
using GameTools.UI;
bool created;
using var mutex = new Mutex(true, @"Global\GameTools_SingleInstance", out created);
if (!created)
{
uint wm = Win32.RegisterWindowMessage("GameTools_ShowMe");
Win32.PostMessage(Win32.HWND_BROADCAST, wm, IntPtr.Zero, IntPtr.Zero);
return;
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
bool startMinimized = args.Any(a =>
a.Equals("--minimized", StringComparison.OrdinalIgnoreCase) ||
a.Equals("--startup", StringComparison.OrdinalIgnoreCase));
try
{
Application.Run(new GameToolsForm(startMinimized));
}
catch (Exception ex)
{
try { Win32.ClipCursor(IntPtr.Zero); } catch { }
MessageBox.Show("Fatal error: " + ex.Message, "GameTools", MessageBoxButtons.OK, MessageBoxIcon.Error);
}