Click here to Skip to main content
11,924,800 members (58,142 online)
Rate this:
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 10: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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151125.3 | 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