DebugProc
The DebugProc
hook procedure is an application-defined or library-defined callback function
that Windows calls before calling the hook procedures associated with any other
type of hook. The system passes information about the hook to be called to the DebugProc
hook procedure, which examines the information and determines whether to allow
the hook to be called.
LRESULT CALLBACK DebugProc(
int nCode, |
// hook code |
WPARAM wParam, |
// type of hook
about to be called |
LPARAM lParam |
// address of
structure with debugging information |
); |
|
Parameters
nCode
Specifies
whether the hook procedure must process the message. If nCode is
HC_ACTION, the hook procedure must process the message. If nCode is less
than zero, the hook procedure must pass the message to the CallNextHookEx
wParam
Specifies the
type of hook about to be called. This parameter can be one of the following
values:
Value |
Description |
WH_CALLWNDPROC |
Installs a
hook procedure that monitors messages sent to a window procedure. For more
information, see the description of the CallWndProc |
WH_CALLWNDPROCRET |
Installs a
hook procedure that monitors messages that have just been processed by a
window procedure. For more information, see the description of the CallWndRetProc |
WH_CBT |
Installs a
hook procedure that receives notifications useful to a computer-based
training (CBT) application. For more information, see the description of the CBTProc |
WH_DEBUG |
Installs a
hook procedure useful for debugging other hook procedures. For more information,
see the description of the DebugProc hook procedure. |
WH_GETMESSAGE |
Installs a
hook procedure that monitors messages posted to a message queue. For more
information, see the description of the GetMsgProc |
WH_JOURNALPLAYBACK |
Installs a
hook procedure that posts messages previously recorded by a WH_JOURNALRECORD
hook procedure. For more information, see the description of the JournalPlaybackProc |
WH_JOURNALRECORD |
Installs a
hook procedure that records input messages posted to the system message
queue. This hook is useful for recording macros. For more information, see
the description of the JournalRecordProc |
WH_KEYBOARD |
Installs a
hook procedure that monitors keystroke messages. For more information, see
the description of the KeyboardProc |
WH_MOUSE |
Installs a
hook procedure that monitors mouse messages. For more information, see the
description of the MouseProc |
WH_MSGFILTER |
Installs a
hook procedure that monitors messages generated as a result of an input event
in a dialog box, message box, menu, or scroll bar. The hook procedure
monitors these messages only for the application that installed the hook
procedure. For more information, see the description of the MessageProc |
WH_SHELL |
Installs a
hook procedure that receives notifications useful to a shell application. For
more information, see the description of the ShellProc |
WH_SYSMSGFILTER |
Installs a hook
procedure that monitors messages generated as a result of an input event in a
dialog box, message box, menu, or scroll bar. The hook procedure monitors
these messages for all applications in the system. For more information, see
the description of the SysMsgProc |
lParam
Points to a DEBUGHOOKINFO
Return Values
To prevent
the system from calling the hook, the return value must be a nonzero value.
Otherwise, the hook procedure must pass the hook information to the CallNextHookEx
Remarks
An
application installs this hook procedure by specifying the WH_DEBUG hook type
and the pointer to the hook procedure in a call to the SetWindowsHookEx
function.
CallWndProc and CallWndRetProc are placeholders for the
application-defined or library-defined function names.
See Also