vasu_sri wrote:
who will create a thread and message queue?
The first thread is created by the operating system when you start an application. Other threads will be created by the application itself, for example by calling the CreateThread Function (Windows)[^]. A message queue is created and maintained by the operating system; the OS creates it only when needed, i.e. when your thread creates a window or calls any function that involves message queues.
vasu_sri wrote:
what relation ship between operating system, thread, message queue, and application?
It's a very generic question, and answer it requires thousands of words... Have you had a look at the documentation on MSDN that I suggested you?