Jump to content

SendMsgHook

From EDM2
Revision as of 19:41, 13 April 2025 by Martini (talk | contribs) (Created page with "This hook filters messages sent by the WinSendMsg function. ==Syntax== SendMsgHook(hab, psmh, fInterTask); ==Parameters== ;''hab'' (HAB) - input: Anchor-block handle. ;''psmh'' (PSMHSTRUCT) - input: Pointer to a send message hook structure. :This a structure contains the parameters to the WinSendMsg function. ;''fInterTask'' (BOOL) - input: Intertask indicator. :TRUE: The message is sent between tasks (intertask). :FALSE: The message is sent within a task (int...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This hook filters messages sent by the WinSendMsg function.

Syntax

SendMsgHook(hab, psmh, fInterTask);

Parameters

hab (HAB) - input
Anchor-block handle.
psmh (PSMHSTRUCT) - input
Pointer to a send message hook structure.
This a structure contains the parameters to the WinSendMsg function.
fInterTask (BOOL) - input
Intertask indicator.
TRUE: The message is sent between tasks (intertask).
FALSE: The message is sent within a task (intratask).

Returns

There is no return value for this hook.

Remarks

This hook may be called whenever a window procedure is called via the WinSendMsg function.

It is called in the context of the sender, whereby if the sender has a queue hook installed it is called, but if the receiver has a queue hook installed it is not called.

The next hook in the chain is always called.

Example Code

#define INCL_WINHOOKS /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HAB        hab;       /* Anchor-block handle. */
PSMHSTRUCT psmh;      /* Pointer to a send message hook structure. */
BOOL       fInterTask;/* Intertask indicator. */

SendMsgHook(hab, psmh, fInterTask);