Partager via


OpenMsgQueue

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

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

Other Resources

Message Queue Point-to-Point