I would like to know what's the best way, in term of efficiency (cpu/memory usage), to temporarily suspend/bypass a low level mouse/keyboard hook.
The current solution I found is to set a global var, "doHook" in the exemple, test it in the hook proc and if not set just let it pass with CallNextHookEx like that :
if ((nCode < 0) || (!doHook))
{
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
Is it a good solution ? a better way ?
Thanks