Window closing is delayed if mouse hook is installed

If I set a low-level mouse hook WH_MOUSE_LL,
when I click the [x] (Close) button , the window delays ~ 500 ms and then disappears.

Do you know what causes a delay? And is there a way to fix this?

(window and hook are created with direct win32 api calls in C ++)

+3
source share
1 answer

WH_MOUSE_LL is a different kind of hook from most others. It is implemented by calling the hook procedure directly, and not to inject the DLL. This requires that the message loop be actively pumped. The chances that there is no one else after closing the window are high. Be sure to contact the WM_CLOSE message handler.

+1
source

Source: https://habr.com/ru/post/1727359/


All Articles