You have 2 options:
- Removing the hook entirely by calling
UnhookWindowsHookEx
. - Leaving the hook in place and skipping normal operation.
Low level keyboard and mouse hooks are somewhat costly, since they introduce additional context switches for handling input events:
The [...] hook is not injected into another process. Instead, the context switches back to the process that installed the hook and it is called in its original context. Then the context switches back to the application that generated the event.
Essentially, your do-nothing hook still uses up thousands of clock cycles for context switching, for all input events. To minimize overall impact you should consider uninstalling the hook entirely and reinstalling it when necessary.