Click here to Skip to main content
11,702,396 members (69,742 online)
Rate this: bad
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

1 solution

Rate this: bad
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:[^].

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 | :) .)


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 515
1 Sergey Alexandrovich Kryukov 355
2 OriginalGriff 299
3 CHill60 145
4 Mika Wendelius 115
0 OriginalGriff 8,369
1 Sergey Alexandrovich Kryukov 7,547
2 CPallini 4,922
3 Maciej Los 4,411
4 Mika Wendelius 3,556

Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2015
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