Jump to content

InputHook

From EDM2
Revision as of 17:19, 13 April 2025 by Martini (talk | contribs) (Created page with "This hook filters messages from the input queue. ==Syntax== InputHook(hab, pQmsg, fs); ==Parameters== ;''hab'' (HAB) - input: Anchor-block handle. ;''pQmsg'' (PQMSG) - input: A QMSG data structure. ;''fs'' (ULONG) - input: Message removal options. :PM_REMOVE Message is being removed from queue :PM_NOREMOVE Message is not being removed from queue ==Returns== ;''rc'' (BOOL) - returns: Processed indicator. :TRUE: The message is not passed on to the next hook in t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This hook filters messages from the input queue.

Syntax

InputHook(hab, pQmsg, fs);

Parameters

hab (HAB) - input
Anchor-block handle.
pQmsg (PQMSG) - input
A QMSG data structure.
fs (ULONG) - input
Message removal options.
PM_REMOVE Message is being removed from queue
PM_NOREMOVE Message is not being removed from queue

Returns

rc (BOOL) - returns
Processed indicator.
TRUE: The message is not passed on to the next hook in the chain or to the application.
FALSE: The message is passed on to the next hook in the chain or to the application.

Remarks

This hook is called when messages are removed from an application queue, before being returned by WinGetMsg or WinPeekMsg. It is called from within these functions just before resuming the application with the message that is returned. There are no restrictions on calls that may be made at this time.

Example Code

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

HAB   hab;   /* Anchor-block handle. */
PQMSG pQmsg; /* A PQMSG data structure. */
ULONG fs;    /* Message removal options. */
BOOL  rc;    /* Processed indicator. */

rc = InputHook(hab, pQmsg, fs);