Switch import table hooks to detours (#14759)
Fixes #14746
Fixes #13335
Partially replaces 7366dee
Summary of the issue:
NVDA doesn't recover when a call to oleacc.AccessibleObjectFromEvent. takes a long time. It instead freezes until the call completes, and the watchdog doesn't cancel it.
See technical discussion in #14746. In short, oleacc and UIAutomationCore don't call SendMessageW and SendMessageTimeoutW in user32 directly so we can't hook the import table of these libraries.
Description of user facing changes
The str in #14746 should no longer be reproducible.
Description of development approach
Import table hooks have been changed to use detours. It was actually pretty trivial to do this. As a bonus, I moved the clipboard hook from the remote to the local library as suggested by @jcsteh
I left the import table hooking mechanism in place, though it is not used by core, it is still available to add-ons.