@rbernon remove_thread_hooks() only removes low level keyboard or mouse hooks, the comment in remove_thread_hooks() says: ``` /* only low-level keyboard/mouse global hooks can be owned by a thread */ ```
My testing around shows that win event hooks, even with WINEVENT_INCONTEXT, are getting removed when the thread which created it exits. The included test shows that. So it looks right to do that (instead of fixing desktop destruction). That is the case even when the hook is not bound to the current process but I made it bound in included test as doing otherwise frequently crashes the explorer here (before the hook is removed on thread exit; such hooking needs hook function in a dll).
The test also revealed that thread id delivered to win event hook function is wrong, it should be window thread (probably reflecting that those events are sent in some different way), but this is unrelated and probably not regressive.