aboutsummaryrefslogtreecommitdiffstats
path: root/WarframeClock
diff options
context:
space:
mode:
authorYour Name <you@example.com>2019-01-17 02:34:13 +0900
committerYour Name <you@example.com>2019-01-17 02:34:13 +0900
commita8ff08420fbd160e9ddbc16b6f5b228c0d853467 (patch)
tree1575cea072f2820ef003e2319903c56d8a901327 /WarframeClock
parent954dbe5c55e935521271eb74d152555188a0d225 (diff)
downloadwf-clock-a8ff08420fbd160e9ddbc16b6f5b228c0d853467.tar.gz
debugging....2019-01-16
Diffstat (limited to 'WarframeClock')
-rw-r--r--WarframeClock/ClockOverlay.cs6
-rw-r--r--WarframeClock/Program.cs19
2 files changed, 19 insertions, 6 deletions
diff --git a/WarframeClock/ClockOverlay.cs b/WarframeClock/ClockOverlay.cs
index 4d873f7..acdd2f7 100644
--- a/WarframeClock/ClockOverlay.cs
+++ b/WarframeClock/ClockOverlay.cs
@@ -152,7 +152,11 @@ namespace WarframeClock
}
Native.Rect newBounds;
- Native.GetWindowRect(targetWindowHandle, out newBounds);
+ if (Native.GetWindowRect(targetWindowHandle, out newBounds) == 0)
+ {
+ targetWindowHandle = IntPtr.Zero;
+ return;
+ }
if (parentBounds.Left != newBounds.Left || parentBounds.Right != newBounds.Right ||
parentBounds.Top != newBounds.Top || parentBounds.Bottom != newBounds.Bottom)
{
diff --git a/WarframeClock/Program.cs b/WarframeClock/Program.cs
index 71514cb..6378173 100644
--- a/WarframeClock/Program.cs
+++ b/WarframeClock/Program.cs
@@ -15,12 +15,21 @@ namespace WarframeClock
[STAThread]
static void Main(string[] args)
{
- clock = new Clock();
+ try
+ {
+ clock = new Clock();
- StartNotifyIcon();
- if (UseWorldStatePhp)
- StartWorldStateFetch();
- StartOverlay();
+ StartNotifyIcon();
+ if (UseWorldStatePhp)
+ StartWorldStateFetch();
+ StartOverlay();
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Main: Uncaught exception: {ex.Message}");
+ Console.WriteLine(ex.StackTrace);
+ MessageBox.Show($"Main: Uncaught exception: {ex.Message}\n{ex.StackTrace}");
+ }
}
private static void StartNotifyIcon()