From f46b876fd68a883555aa7f151381e05a4d91804e Mon Sep 17 00:00:00 2001 From: Yevhenii Holovachov <55396981+yevhenii44@users.noreply.github.com> Date: Mon, 29 Jun 2020 18:19:43 +0300 Subject: [PATCH] Removed hook creating from constructor (#4572) --- src/modules/fancyzones/lib/SecondaryMouseButtonsHook.cpp | 7 ------- src/modules/fancyzones/lib/ShiftKeyHook.cpp | 7 ------- 2 files changed, 14 deletions(-) diff --git a/src/modules/fancyzones/lib/SecondaryMouseButtonsHook.cpp b/src/modules/fancyzones/lib/SecondaryMouseButtonsHook.cpp index ad36dffb67..86c47acc00 100644 --- a/src/modules/fancyzones/lib/SecondaryMouseButtonsHook.cpp +++ b/src/modules/fancyzones/lib/SecondaryMouseButtonsHook.cpp @@ -10,13 +10,6 @@ std::function SecondaryMouseButtonsHook::callback = {}; SecondaryMouseButtonsHook::SecondaryMouseButtonsHook(std::function extCallback) { callback = std::move(extCallback); -#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED) - if (IsDebuggerPresent()) - { - return; - } -#endif - hHook = SetWindowsHookEx(WH_MOUSE_LL, SecondaryMouseButtonsProc, GetModuleHandle(NULL), 0); } void SecondaryMouseButtonsHook::enable() diff --git a/src/modules/fancyzones/lib/ShiftKeyHook.cpp b/src/modules/fancyzones/lib/ShiftKeyHook.cpp index 3cc9b9cbfc..79db4e9aa5 100644 --- a/src/modules/fancyzones/lib/ShiftKeyHook.cpp +++ b/src/modules/fancyzones/lib/ShiftKeyHook.cpp @@ -11,13 +11,6 @@ std::function ShiftKeyHook::callback = {}; ShiftKeyHook::ShiftKeyHook(std::function extCallback) { callback = std::move(extCallback); -#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED) - if (IsDebuggerPresent()) - { - return; - } -#endif - hHook = SetWindowsHookEx(WH_KEYBOARD_LL, ShiftKeyHookProc, GetModuleHandle(NULL), 0); } void ShiftKeyHook::enable()