Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

Optional. The ServiceTypeGuid property of the MSMQQueueInfo object specifies the type of service provided by the queue.

Data type: String (GUID format)
Run-time access: Read/write
Property ServiceTypeGuid As String  

Property Value

A String containing a predefined or application-generated GUID in the form {12345678-1234-1234-1234-123456789ABC}.


Notice the presence of the braces normally used with GUIDs.


ServiceTypeGuid is used to identify the queue by its type of service. This property is typically set when the queue is created, however, the service type identifier of an existing queue can be changed as well.

The service type identifier of a queue can be used to locate public queues registered in the directory service (see MSMQQuery.LookupQueue).

To specify the service type identifier when creating a queue, set the MSMQQueueInfo.PathName property and the ServiceTypeGuid property, and then call the MSMQQueueInfo.Create method.


To generate a GUID, run the Uuidgen.exe program provided by MSDN®.

To reset or retrieve the service type GUID of an existing queue, your application must first obtain an MSMQQueueInfo object that represents the queue. This object can be returned by a query using the MSMQQuery.LookupQueue method or created by the sending or receiving application.

Before using an application-created MSMQQueueInfo object, the application must initialize it to refer to the queue by setting its MSMQQueueInfo.PathName or MSMQQueueInfo.FormatName property. For public queues, setting the FormatName property with a cached public format name instead of the PathName property frees Message Queuing from the need to retrieve information stored in the directory service to generate this format name. Direct format names can be used only for local private queues.

To reset the service type GUID of an open queue, set ServiceTypeGuid to a new GUID and call the MSMQQueueInfo.Update method. This method updates the queue information stored by Message Queuing.

To retrieve the service type identifier of a queue, call the MSMQQueueInfo.Refresh method. The property values of the MSMQQueueInfo object are not updated with the values stored by Message Queuing until the MSMQQueueInfo.Refresh method is called.

Equivalent API Function Property

With function calls, the equivalent property is PROPID_Q_TYPE.

Example Code

The following code fragment illustrates how to specify the service type GUID when creating a queue.

Dim qinfo As New MSMQQueueInfo  
qinfo.PathName = ".\MyNewQ"  
qinfo.ServiceTypeGuid = "{3FC5958E-A9D8-4EC7-9148-C5B446CF9F87}"  

The following example is included in Using Message Queuing.

For an example of See
Setting and retrieving the service type identifier of an existing queue Visual Basic Code Example: Setting MSMQQueueInfo.ServiceTypeGuid

 Visual Basic Code Example: Retrieving MSMQQueueInfo.ServiceTypeGuid


Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib.

See Also