BOOL SetMessageQueue(cMsg)
This function creates a new message queue. It is particularly useful in applications that require a queue that contains more than eight messages (the maximum size of the default queue). The cMsg parameter specifies the size of the new queue; the function must be called from an application's WinMain function before any windows are created and before any messages are sent. The SetMessageQueue function destroys the old queue, along with messages it might contain.
Parameter | Type/Description |
cMsg | int Specifies the maximum number of messages that the new queue may contain. |
The return value specifies whether a new message queue is created. It is nonzero if the function creates a new queue. Otherwise, it is zero.
If the return value is zero, the application has no queue because the SetMessageQueue function deletes the original queue before attempting to create a new one. The application must continue calling SetMessageQueue with a smaller queue size until the function returns a nonzero value.