WinThreadAssocQueue is used by a debug application to process messages on behalf of the program it is debugging. The debug application uses DosPtrace to give control to, or get control from, the program.
A thread always retains an association with the queue it created. An association between a thread and a queue it did not create is temporary.
A thread automatically reassociates itself with its own queue if both thread and queue would otherwise be left unassociated as a result of the WinThreadAssocQueue function. For example, consider this sequence of events:
If queue A is currently not associated with any thread, the thread is automatically reassociated with queue A to prevent the thread from becoming queueless.
Messages can still be posted to the queue, but nothing can be removed from the queue until an association is reestablished. This means that threads that have created windows should not use WinThreadAssocQueue; otherwise, the input system might lock up when it tries to pass a keyboard message or mouse message to a queue without a thread.