Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to change CDialog's background color Pin
Hamid_RT23-May-07 23:17
Hamid_RT23-May-07 23:17 
AnswerRe: how to change CDialog's background color Pin
James R. Twine24-May-07 1:07
James R. Twine24-May-07 1:07 
GeneralRe: how to change CDialog's background color Pin
Peter, Chan24-May-07 21:11
Peter, Chan24-May-07 21:11 
QuestionHelp about capDlgVideoSource Pin
kcynic23-May-07 22:33
kcynic23-May-07 22:33 
AnswerRe: Help about capDlgVideoSource Pin
Mark Salsbery24-May-07 7:05
Mark Salsbery24-May-07 7:05 
QuestionDLL Initialization Failed Pin
Tal S.23-May-07 22:32
Tal S.23-May-07 22:32 
QuestionIs it possible to give window message different priority ? Pin
GameProfessor23-May-07 22:14
GameProfessor23-May-07 22:14 
AnswerRe: Is it possible to give window message different priority ? Pin
Roger Stoltz23-May-07 23:28
Roger Stoltz23-May-07 23:28 
GameProfessor wrote:
I wonder if it is possible to give window message different priority, or in other word, one message can interrupt the message queue and is processed before other messages although it arrives in the message queue


Not unless you invent it yourself with a different message queue that you handle yourself.
Windows messages can be considered to have three priority levels. Posted messages have the highest priority. This means that they have a higher priority than input messages which are the next priority level. WM_PAINT and WM_TIMER have the lowest priority, in fact they are "pseudo" messages that not even make it to the message queue. The messages are simulated by setting a flag instead and they are processed when the message queue is empty. This also means that even if a timer has expired multiple times before being handled, the message handler for the WM_TIMER message will only be called once.


GameProfessor wrote:
if that's not possible, what's your solution to handle the situations when a window have to process a long message queue, could be > 10 or even 20 messages waiting to be processed.


Depends on the situation, you have to elaborate more on the problem you're trying to solve.
I suspect I would use a worker thread reading a queue with application specific contents and not use the windows message queue. The thread would wait for a semaphore that is released when a new object is placed in the queue and process the new object. But this could be a bad solution, it depends on what you're trying to do.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown

QuestionObject Ids for my menu options Pin
prithaa23-May-07 21:56
prithaa23-May-07 21:56 
QuestionRe: Object Ids for my menu options Pin
Naveen23-May-07 22:06
Naveen23-May-07 22:06 
AnswerRe: Object Ids for my menu options Pin
prithaa23-May-07 23:18
prithaa23-May-07 23:18 
GeneralRe: Object Ids for my menu options Pin
Naveen23-May-07 23:25
Naveen23-May-07 23:25 
GeneralRe: Object Ids for my menu options Pin
prithaa24-May-07 0:08
prithaa24-May-07 0:08 
GeneralRe: Object Ids for my menu options Pin
Naveen24-May-07 0:12
Naveen24-May-07 0:12 
GeneralRe: Object Ids for my menu options Pin
prithaa24-May-07 0:44
prithaa24-May-07 0:44 
Questionvirus Pin
saisp23-May-07 21:52
saisp23-May-07 21:52 
JokeRe: virus Pin
Optimus Chaos23-May-07 22:29
Optimus Chaos23-May-07 22:29 
JokeRe: virus Pin
Rajesh R Subramanian23-May-07 22:42
professionalRajesh R Subramanian23-May-07 22:42 
JokeRe: virus Pin
Hamid_RT23-May-07 23:18
Hamid_RT23-May-07 23:18 
GeneralRe: virus Pin
David Crow24-May-07 4:10
David Crow24-May-07 4:10 
JokeRe: virus Pin
Mark Salsbery24-May-07 7:09
Mark Salsbery24-May-07 7:09 
QuestionMessage Way Pin
baerten23-May-07 21:49
baerten23-May-07 21:49 
AnswerRe: Message Way Pin
Naveen23-May-07 22:04
Naveen23-May-07 22:04 
GeneralRe: Message Way Pin
baerten23-May-07 22:10
baerten23-May-07 22:10 
GeneralRe: Message Way Pin
Naveen23-May-07 22:15
Naveen23-May-07 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.