Jump to content

WinWaitMsg: Difference between revisions

From EDM2
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 :..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function waits for a filtered message.  
This function waits for a filtered message.
 
==Syntax==
==Syntax==
  WinWaitMsg(hab, ulFirst, ulLast)
  WinWaitMsg(hab, ulFirst, ulLast)


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


==Returns==
==Returns==
;rc (BOOL) - returns
;rc (BOOL) - returns:Success indicator.
:Success indicator.
:;TRUE:Successful completion
 
:;FALSE:Error occurred.
:;TRUE
::Successful completion  
:;FALSE
::Error occurred.


==Remarks==
==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.
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.  
For details of the filtering performed by ulFirst and ulLast, see the WinGetMsg function.


==Example Code==
==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.  
In this example the pointer is kept hidden until mouse activity is detected. The WinWaitMsg call is used to wait for any mouse message.
 
<pre>
<pre>
#define INCL_WINWINDOWMGR
#define INCL_WINWINDOWMGR
Line 90: Line 81:
* WinSetMsgInterest
* WinSetMsgInterest
* WinSetMsgMode
* WinSetMsgMode
* WinSetSynchroMode  
* WinSetSynchroMode


[[Category:Win]]
[[Category:Win]]

Latest revision as of 14:53, 16 May 2023

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