WinCallMsgFilter
Appearance
This function calls a message-filter hook.
Syntax
WinCallMsgFilter(hab, pqmsg, ulFilter);
Parameters
hab (HAB) - input
Anchor-block handle.
pqmsg (PQMSG) - input
Message to be passed to the message-filter hook.
ulFilter (ULONG) - input
Filter.
Message-filter code passed to the message-filter hook. This can be an application-specific value or one of the following standard MSGF_* values:
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 rclTrack and the fs parameters are updated. MSGF_DRAG Direct manipulation mode loop. MSGF_DDEPOSTMSG DDE post message mode loop.
Returns
- rc (BOOL) - returns
- Message-filter hook return indicator.
- TRUE
- A message-filter hook returns TRUE
- FALSE
- All message-filter hooks return FALSE, or no message-filter hooks are defined.
Remarks
This function allows an application to pass a message to the message-filter hook procedure(s).
Example Code
This example calls a message filter hook and passes a WM_CLOSE message in message box mode.
#define INCL_WINHOOKS /* Window Hook Functions */ #include <os2.h> BOOL fHookRet; /* filter hook return indicator */ HAB hab; /* Anchor-block handle */ QMSG pqmsg; /* Message to be passed to the message-filter hook */ ULONG ulFilter; /* Filter */ POINTL ptrPos = {5L,5L};/* pointer position */ /* initialize message structure */ pqmsg.hwnd = HWND_DESKTOP; pqmsg.msg = WM_CLOSE; pqmsg.mp1 = MPVOID; pqmsg.mp2 = MPVOID; pqmsg.time = 0L; pqmsg.ptl = ptrPos; /* call hook in message box mode */ ulFilter = MSGF_MESSAGEBOX; fHookRet = WinCallMsgFilter(hab, &pqmsg, ulFilter);
#define INCL_WINHOOKS /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HAB hab; /* Anchor-block handle. */ PQMSG pqmsg; /* Message to be passed to the message-filter hook. */ ULONG ulFilter; /* Filter. */ BOOL rc; /* Message-filter hook return indicator. */ rc = WinCallMsgFilter(hab, pqmsg, ulFilter);
Related Functions
- WinCallMsgFilter
- WinReleaseHook
- WinSetHook