INFO: Importance of Calling DefHookProc()ID: Q74547
|
When an application installs a hook using SetWindowsHook(), Windows adds
the hook's callback filter function to the hook chain. It is the
responsibility of each callback function to call the next function in the
chain. DefHookProc() is used to call the next function in the hook chain
for Windows 3.0. DefHookProc() is retained in Windows 3.1 for backwards
compatibility. For Windows 3.1, you should use CallNextHookEx() to call
the next function in the hook chain.
For Win32, mouse and keyboard hooks can suppress messages by return value
and do not have to call CallNextHookEx(), unless they want to pass the
message on. Other hooks, like WH_CALLWNDPROC, don't need to call
CallNextHookEx(), because it will be called by the system. However, all
hooks should call CallNextHookEx() immediately if nCode<0.
Keywords : kbHook kbNTOS kbGrpUser kbWinOS
Version :
Platform :
Issue type : kbinfo
Last Reviewed: March 7, 1999