The CreateTime property of the MSMQQueueInfo object indicates when the public queue or private queue (introduced in MSMQ 2.0) was created.
Property CreateTime As Variant
A Variant of subtype Date containing the date and time when the queue was created.
Message Queuing sets this property, storing the value of the property when the queue is created. Once retrieved, the value of CreateTime can be manipulated using standard Microsoft® Visual Basic® date and time functions such as Date$ and Time$. For descriptions of Visual Basic functions, see the Visual Basic documentation.
When CreateTime is displayed, Visual Basic automatically converts the property value to the local system time and system date.
The CreateTime property can be used as search criteria when making a query of existing public queues. See the MSMQQuery.LookupQueue method for details on running a query.
To retrieve the CreateTime property of a 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 reference 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 retrieve the stored create time of a queue, call the MSMQQueueInfo.Refresh method and inspect the CreateTime property. Message Queuing stores the create time in the directory service (for public queues) and on the local computer (for private queues). 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_CREATE_TIME.
The following example is included in Using Message Queuing.
For an example of
Retrieving the date and time when an existing queue was created
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.