From e4b9d0e39f676d1860754d14dab32bbe7b9da3fb Mon Sep 17 00:00:00 2001 From: Sam Johnson Date: Wed, 26 Feb 2025 21:35:41 -0600 Subject: [PATCH] Ignore monitor cache when using TasksService events --- src/ManagedShell.WindowsTasks/ApplicationWindow.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ManagedShell.WindowsTasks/ApplicationWindow.cs b/src/ManagedShell.WindowsTasks/ApplicationWindow.cs index 03411df5..2612d3f8 100644 --- a/src/ManagedShell.WindowsTasks/ApplicationWindow.cs +++ b/src/ManagedShell.WindowsTasks/ApplicationWindow.cs @@ -301,8 +301,9 @@ public IntPtr HMonitor { get { - if (_hMonitor == IntPtr.Zero) + if (_hMonitor == IntPtr.Zero || EnvironmentHelper.IsWindows8OrBetter) { + // Ignore the cache on Windows 8+, as it may be wrong. SetMonitor(); }