Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Win32 GDI
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 21-Nov-12 9:29am
hills32214

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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 Smile | :) .)
 
—SA
  Permalink  
v2

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

  Print Answers RSS
0 Maciej Los 655
1 OriginalGriff 453
2 CPallini 239
3 CHill60 180
4 Sergey Alexandrovich Kryukov 175
0 OriginalGriff 6,092
1 Sergey Alexandrovich Kryukov 4,898
2 Maciej Los 3,159
3 Peter Leow 3,129
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100