diff --git a/src/Dapplo.Windows.Common/Structs/NativeRect.cs b/src/Dapplo.Windows.Common/Structs/NativeRect.cs
index 31f608a1..5d6ad635 100644
--- a/src/Dapplo.Windows.Common/Structs/NativeRect.cs
+++ b/src/Dapplo.Windows.Common/Structs/NativeRect.cs
@@ -277,7 +277,7 @@ public bool Equals(NativeRect other)
/// Checks if this NativeRect is empty
///
/// true when empty
- public bool IsEmpty => Width * Height == 0;
+ public bool IsEmpty => unchecked (Width * Height) == 0;
///
[Pure]
diff --git a/src/Dapplo.Windows.Common/Structs/NativeSize.cs b/src/Dapplo.Windows.Common/Structs/NativeSize.cs
index 77771220..d53da8c2 100644
--- a/src/Dapplo.Windows.Common/Structs/NativeSize.cs
+++ b/src/Dapplo.Windows.Common/Structs/NativeSize.cs
@@ -204,7 +204,7 @@ public NativeSize(int width, int height)
///
[Pure]
- public int CompareTo(NativeSize other) => (other.Width * other.Height).CompareTo(Width * Height);
+ public int CompareTo(NativeSize other) => unchecked (other.Width * other.Height).CompareTo(unchecked(Width * Height));
///
[Pure]
diff --git a/src/Dapplo.Windows.Common/Structs/NativeSizeFloat.cs b/src/Dapplo.Windows.Common/Structs/NativeSizeFloat.cs
index 56e55da5..1db2bd7a 100644
--- a/src/Dapplo.Windows.Common/Structs/NativeSizeFloat.cs
+++ b/src/Dapplo.Windows.Common/Structs/NativeSizeFloat.cs
@@ -315,7 +315,7 @@ public bool Equals(NativeSizeFloat other)
///
[Pure]
- public int CompareTo(NativeSizeFloat other) => (other.Width * other.Height).CompareTo(Width * Height);
+ public int CompareTo(NativeSizeFloat other) => unchecked(other.Width * other.Height).CompareTo(unchecked (Width * Height));
///
[Pure]
diff --git a/src/Dapplo.Windows.Messages/Dapplo.Windows.Messages.csproj b/src/Dapplo.Windows.Messages/Dapplo.Windows.Messages.csproj
index 1c037e46..2e6ca3e6 100644
--- a/src/Dapplo.Windows.Messages/Dapplo.Windows.Messages.csproj
+++ b/src/Dapplo.Windows.Messages/Dapplo.Windows.Messages.csproj
@@ -9,9 +9,10 @@
true
-
+
all
+
diff --git a/src/Dapplo.Windows.Messages/WinProcHandler.cs b/src/Dapplo.Windows.Messages/WinProcHandler.cs
index e0372311..8ab03355 100644
--- a/src/Dapplo.Windows.Messages/WinProcHandler.cs
+++ b/src/Dapplo.Windows.Messages/WinProcHandler.cs
@@ -28,6 +28,7 @@
using System.Linq;
using System.Reactive.Disposables;
using System.Windows.Interop;
+using Dapplo.Log;
#endregion
@@ -38,6 +39,7 @@ namespace Dapplo.Windows.Messages
///
public class WinProcHandler
{
+ private static readonly LogSource Log = new LogSource();
private static HwndSource _hWndSource;
///
@@ -64,14 +66,12 @@ private HwndSource MessageHandlerWindow
{
return _hWndSource;
}
- if (_hWndSource != null && !_hWndSource.IsDisposed)
- {
- return _hWndSource;
- }
// Create a new message window
_hWndSource = CreateMessageWindow();
+ Log.Verbose().WriteLine("MessageHandlerWindow with handle {0} was created.", _hWndSource.Handle);
_hWndSource.Disposed += (sender, args) =>
{
+ Log.Verbose().WriteLine("MessageHandlerWindow with handle {0} is disposed.", _hWndSource.Handle);
UnsubscribeAllHooks();
};
// Hook automatic removing of all the hooks