OpenMsgQueue (Compact 2013)

3/28/2014

This function opens a handle to an existing message queue based on a message queue handle.

Syntax

HANDLE OpenMsgQueue(
  HANDLE hSrcProc,
  HANDLE hMsgQ,
  LPMSGQUEUEOPTIONS lpOptions
);

Parameters

  • hSrcProc
    [in] Handle to a source process that owns the hMsgQ message queue handle.
  • hMsgQ
    [in] Event handle to a message queue returned by the CreateMsgQueue function.
  • lpOptions
    [in] Pointer to an MSGQUEUEOPTIONS structure that sets the properties of the message queue.

Return Value

A handle to a message queue indicates success. NULL indicates that the queue could not be opened.

Remarks

Use the CloseMsgQueue function to close the handle returned by the OpenMsgQueue function. When called, the OpenMsgQueue function checks only the values of the dwSize and bReadAccess members of the lpOptions parameter.

Requirements

Header

msgqueue.h

Library

coredll.lib

See Also

Reference

Message Queue Point-to-Point Functions
CloseMsgQueue
CreateMsgQueue
GetMsgQueueInfo
MSGQUEUEINFO
MSGQUEUEOPTIONS
ReadMsgQueue
ReadMsgQueueEx
WriteMsgQueue