"Unhooked" the Shortcut guide module from the PT event dispatcher (#2318)

* "Unhooked" the Shortcut guide module from the PT event dispatcher

* Fixup: warning/undefined behavior/terrible bug

* SetWindowsHookEx and UnhookWindowsHookEx now fail silently

* Updated a comment in shortcut_guide.h

* Renamed a method, added an error message
This commit is contained in:
Ivan Stošić
2020-04-30 11:05:18 +02:00
committed by GitHub
parent 2d23952181
commit 2db98715cc
2 changed files with 60 additions and 15 deletions

View File

@@ -22,6 +22,8 @@ public:
virtual void enable() override;
virtual void disable() override;
virtual bool is_enabled() override;
// PowerToys interface method, not used
virtual intptr_t signal_event(const wchar_t* name, intptr_t data) override;
virtual void register_system_menu_helper(PowertoySystemMenuIface* helper) override {}
@@ -32,6 +34,9 @@ public:
void quick_hide();
void was_hidden();
// Method called from LowLevelKeyboardProc
intptr_t signal_event(LowlevelKeyboardEvent* event);
virtual void destroy() override;
private:
@@ -39,6 +44,7 @@ private:
std::unique_ptr<TargetState> target_state;
std::unique_ptr<D2DOverlayWindow> winkey_popup;
bool _enabled = false;
HHOOK hook_handle;
void init_settings();
void disable(bool trace_event);