Jump to content

WinWaitMsg

From EDM2
Revision as of 19:43, 15 May 2023 by Martini (talk | contribs) (Created page with "This function waits for a filtered message. ==Syntax== WinWaitMsg(hab, ulFirst, ulLast) ==Parameters== ;hab (HAB) - input :Anchor-block handle. ;ulFirst (ULONG) - input :...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function waits for a filtered message.

Syntax

WinWaitMsg(hab, ulFirst, ulLast)

Parameters

hab (HAB) - input
Anchor-block handle.
ulFirst (ULONG) - input
First message identity.
ulLast (ULONG) - input
Last message identity.

Returns

rc (BOOL) - returns
Success indicator.
TRUE
Successful completion
FALSE
Error occurred.

Remarks

This function causes the current thread to wait for a message to arrive on the message queue associated with hab. This must be the next message since the queue was last inspected by a rc return from WinGetMsg or WinPeekMsg. It must also conform to the filtering criteria specified by ulFirst and ulLast.

For details of the filtering performed by ulFirst and ulLast, see the WinGetMsg function.

Example Code

In this example the pointer is kept hidden until mouse activity is detected. The WinWaitMsg call is used to wait for any mouse message.

#define INCL_WINWINDOWMGR
#define INCL_WINPOINTERS
#define INCL_WINDESKTOP
#define INCL_WININPUT
#include <OS2.H>

HWND hwnd;
HPOINTER hpointer;
HAB hab;

/* Get the pointer handle */
hpointer = WinQueryPointer(HWND_DESKTOP);

/* Hide the mouse */
WinShowPointer(hwnd,FALSE);

/* All the mouse messages from WM_MOUSEFIRST */
/* to WM_BUTTON3DBLCLK inclusive             */
WinWaitMsg(hab,
           WM_MOUSEFIRST,
           WM_BUTTON3DBLCLK);

/* If there has been any mouse activity, show the mouse */
WinShowPointer(hwnd,TRUE);

Definition

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

HAB      hab;      /*  Anchor-block handle. */
ULONG    ulFirst;  /*  First message identity. */
ULONG    ulLast;   /*  Last message identity. */
BOOL     rc;       /*  Success indicator. */

rc = WinWaitMsg(hab, ulFirst, ulLast);

Related Functions

  • WinBroadcastMsg
  • WinCreateMsgQueue
  • WinDestroyMsgQueue
  • WinDispatchMsg
  • WinGetDlgMsg
  • WinGetMsg
  • WinInSendMsg
  • WinPeekMsg
  • WinPostMsg
  • WinPostQueueMsg
  • WinQueryMsgPos
  • WinQueryMsgTime
  • WinQueryQueueInfo
  • WinQueryQueueStatus
  • WinSendDlgItemMsg
  • WinSendMsg
  • WinSetClassMsgInterest
  • WinSetMsgInterest
  • WinSetMsgMode
  • WinSetSynchroMode