Jump to content

MsgFilterHook: Difference between revisions

From EDM2
Created page with "This hook filters messages from inside a mode loop. ==Syntax== rc = MsgFilterHook(hab, pQmsg, msgf); ==Parameters== ;''hab'' (HAB) - input: Anchor-block handle. ;''pQmsg'' (PQMSG) - input: A queue message data structure. ;''msgf'' (ULONG) - input: Context in which the hook has been called. :MSGF_DIALOGBOX Dialog-box mode loop. :MSGF_TRACK Window-movement and size tracking. When this hook is used the TRACKINFO structure specified the ''ptiTrackinfo'' parameter of th..."
 
No edit summary
 
Line 2: Line 2:


==Syntax==
==Syntax==
rc = MsgFilterHook(hab, pQmsg, msgf);
MsgFilterHook(hab, pQmsg, msgf);


==Parameters==
==Parameters==

Latest revision as of 19:35, 13 April 2025

This hook filters messages from inside a mode loop.

Syntax

MsgFilterHook(hab, pQmsg, msgf);

Parameters

hab (HAB) - input
Anchor-block handle.
pQmsg (PQMSG) - input
A queue message data structure.
msgf (ULONG) - input
Context in which the hook has been called.
MSGF_DIALOGBOX Dialog-box mode loop.
MSGF_TRACK Window-movement and size tracking. When this hook is used the TRACKINFO structure specified the ptiTrackinfo parameter of the WinTrackRect function is updated to give the current state before the hook is called. Only the parameters are updated.
MSGF_DRAG Direct manipulation mode loop.
MSGF_DDEPOSTMSG DDE post message mode loop.
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.

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 inside any of the system-mode loops, for instance, during size-tracking or move-tracking, or while a dialog box or menu is displayed.

The WM_QUIT message is passed to this hook, if it occurs during a mode loop.

Related Messages

Example Code

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

HAB   hab;   /* Anchor-block handle. */
PQMSG pQmsg; /* A queue message data structure. */
ULONG msgf;  /* Context in which the hook has been called. */
BOOL  rc;    /* Processed indicator. */

rc = MsgFilterHook(hab, pQmsg, msgf);