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%).
If not calling
m_GlobalHook.Dispose();
, then the program may just be runningOnMouseMove
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%).