What does Windows error code 1426 (ERROR_INVALID_HOOK_FILTER) mean?

 
Previous Next
ERROR_DC_NOT_FOUND ERROR_INVALID_FILTER_PROC

ERROR_INVALID_HOOK_FILTER

The hook filter type is invalid

SetWindowsHookEx selects a hook chain with the idHook parameter, using values such as WH_CALLWNDPROC, WH_GETMESSAGE, WH_KEYBOARD, or low-level keyboard/mouse hooks. The type determines callback semantics and scope requirements.

Passing an arbitrary event code, a WinEvent constant, or a value from a different callback API is a category error. Version-dependent hook support also matters: journaling hooks are not supported on Windows 11 and newer, where Microsoft recommends other input APIs.

What to check

  • Log the symbolic WH_* value rather than only the integer.
  • Verify the callback signature matches the selected hook type.
  • Keep WinEvent hooks and Windows message hooks in separate wrappers.
  • Review OS support when relying on journaling hook types.

This differs from ERROR_HOOK_TYPE_NOT_ALLOWED: an allowed-value check can recognize a hook type yet reject its use in a particular environment or policy context.

References


Looking for a different code? Search another status or error code.