Skip to content

Conversation

@gdh1995
Copy link

@gdh1995 gdh1995 commented Jul 20, 2017

If not calling m_GlobalHook.Dispose();, then the program may just be running OnMouseMove when it's to exit. If it runs into this case, an exception is thrown and the mouse hook doesn't return to system correctly, so mouse gets trapped and you can not move it any more - until Windows finds a timeout in seconds and resets mouse.

Also try to unload this hook if possible, mainly for lowest CPU cost (0.2% -> 0%).

also try to unload this hook if possible - for lowest CPU cost
@bfritscher bfritscher changed the base branch from beta to mouse-click-highlight July 20, 2017 13:13
@bfritscher bfritscher changed the base branch from mouse-click-highlight to beta July 20, 2017 13:13
@bfritscher bfritscher merged commit 2c2da94 into bfritscher:beta Jul 20, 2017
@bfritscher
Copy link
Owner

Thanks!

@gdh1995 gdh1995 deleted the ensure-hooks-are-disposed branch July 20, 2017 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants