3

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

Do you know what causes the delay? And, is there a way to fix it?

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

Nick Dandoulakis
  • 42,588
  • 16
  • 104
  • 136

1 Answers1

1

WH_MOUSE_LL is a different kind of hook from most other ones. It is implemented by calling the hook procedure directly rather than injecting a DLL. That requires a message loop to be actively pumping. The odds that there isn't one anymore after you close a window are high. Be sure to unhook in the WM_CLOSE message handler.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536