From 559eebbb702ead806b20fffa0a2fe45c5f845ed1 Mon Sep 17 00:00:00 2001 From: Boris Makogonyuk Date: Wed, 14 Oct 2015 18:41:45 +0200 Subject: [PATCH] Issue: If Wox was set to ignore hotkeys on full-screen it would fail. Cause: Compared IntPtr with null. IntPtr is never null. --- Wox/Helper/WindowIntelopHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Wox/Helper/WindowIntelopHelper.cs b/Wox/Helper/WindowIntelopHelper.cs index feccd8f6a4..4a0223a19e 100644 --- a/Wox/Helper/WindowIntelopHelper.cs +++ b/Wox/Helper/WindowIntelopHelper.cs @@ -13,21 +13,21 @@ namespace Wox.Helper private const int WS_SYSMENU = 0x80000; //WPF's Message code for System Menu private static IntPtr _hwnd_shell; private static IntPtr _hwnd_desktop; - + //Accessors for shell and desktop handlers //Will set the variables once and then will return them private static IntPtr HWND_SHELL { get { - return _hwnd_shell != null ? _hwnd_shell : _hwnd_shell = GetShellWindow(); + return _hwnd_shell != IntPtr.Zero ? _hwnd_shell : _hwnd_shell = GetShellWindow(); } } private static IntPtr HWND_DESKTOP { get { - return _hwnd_desktop != null ? _hwnd_desktop : _hwnd_desktop = GetDesktopWindow(); + return _hwnd_desktop != IntPtr.Zero ? _hwnd_desktop : _hwnd_desktop = GetDesktopWindow(); } }