From here , you already know that the options are:
Function Open(Access, ShareMode)
and they also say that
Access can be set to one of the following values:
MQ_PEEK_ACCESS: Messages can only be viewed. They cannot be removed from the queue.
MQ_SEND_ACCESS: Messages can only be sent to the queue.
MQ_RECEIVE_ACCESS: messages can be restored (read and deleted) from the queue, peeked or cleared. See the description of the ShareMode argument for information on who can receive messages from the queue.
MQ_PEEK_ACCESS | MQ_ADMIN_ACCESS: Messages in the local outgoing queue can only be viewed (read without deleting from the queue).
MQ_RECEIVE_ACCESS | MQ_ADMIN_ACCESS: messages in the local outgoing queue can be received (read and deleted from the queue), peered at (read without deleting from the queue), or cleared (deleted).
In the MSDN docs for MQACCESS, they give numerical values for constants:
typedef enum { MQ_RECEIVE_ACCESS = 1, MQ_SEND_ACCESS = 2, MQ_PEEK_ACCESS = 0x0020, MQ_ADMIN_ACCESS = 0x0080 } MQACCESS;
The second parameter, ShareMode:
ShareMode indicates who can access the queue. Set one of the following values:
MQ_DENY_NONE: The default value. The queue is available to all members of the Everyone group. This parameter should be used if the Access parameter is set to MQ_PEEK_ACCESS or MQ_SEND_ACCESS.
MQ_DENY_RECEIVE_SHARE: Limits those who can receive messages from the queue to this process. If the queue is already open for retrieving messages by another process, this call fails and an error MQ_ERROR_SHARING_VIOLATION (0xC00E0009) is generated. Applicable only if Access is set to MQ_RECEIVE_ACCESS.
These constants are:
Const MQ_DENY_NONE = 0 Const MQ_DENY_RECEIVE_SHARE = 1
it's really a little hard to find, but you can get it, for example, here , which is not a very reliable source, but I believe it is correct.