win12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
WinReleaseHook (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINHOOKS
 
BOOL WinReleaseHook(hab, hmq, iHook, pfnHook, hmod)
HAB hab;         /* handle of the anchor block               */
HMQ hmq;         /* handle of the message queue              */
SHORT iHook;     /* hook identifier                          */
PFN pfnHook;     /* address of the hook procedure            */
HMODULE hmod;    /* handle of the module with hook procedure */
 
The WinReleaseHook function releases an application hook from a hook chain.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hab        Identifies the anchor block.
 
hmq        Specifies the message queue from which the hook is to be
           released. If hmq is NULL, the hook is released from the system
           hook chain. If hmq is HMQ_CURRENT, the hook is released from the
           message queue associated with the current thread (calling
           thread).
 
iHook      Specifies the type of hook chain. This parameter can be one of
           the following values:
 
           Hook type           Description
           ─────────────────────────────────────────────────────────────────
           HK_HELP             Monitors the WM_HELP message.
 
           HK_INPUT            Monitors messages in a message queue.
 
           HK_JOURNALPLAYBACK  Allows applications to insert events into the
                               system input queue.
 
           HK_JOURNALRECORD    Allows applications to record system input
                               queue events.
 
           HK_MSGFILTER        Monitors input events during system modal
                               loops.
 
           HK_SENDMSG          Monitors messages sent with WinSendMsg.
 
pfnHook    Points to the hook routine.
 
hmod       Identifies the module that contains the hook procedure. This
           parameter can be either the module handle returned by the
           DosLoadModule function or NULL for the application's module.
 
Return Value
 
The return value is TRUE if the function is successful or FALSE if an error
occurs.
 
Comments
 
If a system hook is called by a process other than the process that set the
hook, the DLL containing the hook will not be unloaded until every process
is exited that referenced it. For most system hooks, this applies until the
machine is rebooted. For the most part, this is not a problem; as with
swapping, the unused DLL will end up somewhere in your swap space, never to
be used again. The only complication is that when you are developing the
hook the DLL containing the hook is still in use, and you cannot copy over
it or link into it.
 
See Also
 
DosLoadModule, WinSendMsg, WinSetHook