UnhookWindowsHookEx

  BOOL UnhookWindowsHookEx(hhk)    
  HHOOK hhk; /* handle of hook function to remove */

This function is called to remove a hook from the system. The hook is specified by the hhk parameter which was returned from SetWindowsHookEx. The hook can be in the state of being called by another thread even after UnhookWindowsHookEx returns. If the hook isn't being called concurrently, the hook is removed immediately before UnhookWindowsHookEx returns.

Parameters

hhk

Identifies the hook to be removed. This value is an id specifying a particular hook. It must have been originally returned from SetWindowsHookEx.

Return Value

The return value is TRUE if the function is successful or FALSE if an error occurs. This routine may fail if the hhk parameter does not accurately identify a hook that this process set.

See Also

SetWindowsHookEx, UnhookWindowsHook