Reads an element from a queue.
#define INCL_DOSQUEUES
#include <os2.h>
HQUEUE hq; /* The handle of the queue from which an element is to be removed. */
PREQUESTDATA pRequest; /* A pointer to a REQUESTDATA that returns a PID and an event code. */
PULONG pcbData; /* A pointer to the length, in bytes, of the data that is being removed. */
PPVOID ppbuf; /* A pointer to the element that is being removed from the queue. */
ULONG element; /* An indicator that specifies whether to remove the first element in the queue or the queue element that was previously examined by DosPeekQueue. */
BOOL32 wait; /* The action to be performed when no entries are found in the queue. */
PBYTE ppriority; /* The address of the element's priority value. */
HEV hsem; /* The handle of an event semaphore that is to be posted when data is added to the queue and wait is set to 1. */
APIRET ulrc; /* Return Code. */
ulrc = DosReadQueue(hq, pRequest, pcbData,
ppbuf, element, wait, ppriority,
hsem);