Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If my application has multiple windows classes - RegisterClass() function calls - each with a different .lpfnWndProc procedure, do I need multiple threads and multiple windows message queues, or should I be able to make that work with a single thread and a single windows message queue?
Posted

1 solution

No. The message queue is one. And one UI thread per all UI elements, even if you use many threads in the process.

In addition to threading, you should also understand how event-oriented UI technologies work. For windows, this knowledge is around the idea of the message loop of the application. This short article will give you the idea:
http://www.winprog.org/tutorial/message_loop.html[^].

Well, on a very advanced side, it is possible to have more than one UI thread each executing its independent UI with separate message queue, but this is hardly practical and hardly worth considering. (I experimented with this on Windows and Mac OS X, to resolve really tricky problem related to porting of the Windows-only application to multi-platform, and the port could operate on two different UIs at the same time. So, the experiments demonstrated that it is possible, but I mentioned about it just for completeness. Strictly speaking, this is possible, but hardly should be considered. You asked about "require" — no, multiple classes do not require it, not at all :-).)

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900