0

It seems that I have not yet encountered a problem that is solved in this way. However, in different places I notice similar "protection".

For example, I saw this in X-Mouse Button Control: https://i.stack.imgur.com/h5esO.png

For what reason are hooks reset and is it relevant for modern versions of windows (7, 8.1, 10, 11)?

Alex A.
  • 111
  • 7

1 Answers1

0

It relevant for all versions of windows, as mouse events and their hooks haven't changed in decades.

Products that add power control of the mouse need to modify how the active program is notified about mouse events.

Microsoft defines Hooks as follows:

A hook is a point in the system message-handling mechanism where an application can install a subroutine to monitor the message traffic in the system and process certain types of messages before they reach the target window procedure.

The mouse-control product then intercepts the messages sent by Windows to the active window and modify or replace them with its own messages.

This mechanism hasn't changed in ages, so it's still fully relevant, and will still stay relevant for the future.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • But **why**? *What happens* when the computer wakes up from sleep mode? *Why are hooks being dropped?* I do not understand. Even if the hook mechanism is old and came from windows 95, why was it so necessary to recreate the hooks on wake up? After all, there was already **PnP** ... – Alex A. Jul 05 '21 at 18:50
  • And were there real cases when re-creating hooks helped? It works for me without it. And it seems stable. But I'm not sure about the stability, so I ask. – Alex A. Jul 05 '21 at 18:57
  • Windows should wake up from sleep in exactly the state as it was before. I can only guess that perhaps some mouse exists (or did exist) where on wake the software that came with the mouse somehow invalidated the hooks (perhaps it restarted itself). – harrymc Jul 05 '21 at 19:35