Sent Message
-
The Messages which are post,they are synchronized due to message queue.What about the messages which are sent?
never say die
I am not sure what you mean by synchronized. Window messages are placed into a FIFO stack and each message has a priority level. They are processed and removed from the stack based on location in the stack and priority level of the message type. This is a part of MS Windows that has evolved over the years, working slightly differently in older versions. However with that being said, currently in Windows XP and Windows Vista The Send* message functions bypass the standard message que and are pushed onto a seperate FIFO stack of nonqueued messages. These messages are processed with higher priority than messages which are in the standard message que. To read more about messages and message queues, the MSDN has an excellent article located here: http://msdn2.microsoft.com/en-us/library/ms644927.aspx[^] Best Wishes, -Randor (David Delaune)
-
I am not sure what you mean by synchronized. Window messages are placed into a FIFO stack and each message has a priority level. They are processed and removed from the stack based on location in the stack and priority level of the message type. This is a part of MS Windows that has evolved over the years, working slightly differently in older versions. However with that being said, currently in Windows XP and Windows Vista The Send* message functions bypass the standard message que and are pushed onto a seperate FIFO stack of nonqueued messages. These messages are processed with higher priority than messages which are in the standard message que. To read more about messages and message queues, the MSDN has an excellent article located here: http://msdn2.microsoft.com/en-us/library/ms644927.aspx[^] Best Wishes, -Randor (David Delaune)
By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007
never say die
-
By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007
never say die
-
By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007
never say die
Do you know what a message queue is?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007
never say die
The MSDN is somewhat misleading in that it states: "directly calls the WndProc" This is only true if the window belongs to the same thread executing SendMessage() In other words... if Thread1 executes SendMessage() to a window it owns, the WndProc is directly executed. If Thread1 executes SendMessage() to a window owned by Thread2, the message is placed into a seperate que. This special que contains messages of extreme high priority. This que is not the same as the standard message que. Hope it helps, -Randor (David Delaune)
-
The MSDN is somewhat misleading in that it states: "directly calls the WndProc" This is only true if the window belongs to the same thread executing SendMessage() In other words... if Thread1 executes SendMessage() to a window it owns, the WndProc is directly executed. If Thread1 executes SendMessage() to a window owned by Thread2, the message is placed into a seperate que. This special que contains messages of extreme high priority. This que is not the same as the standard message que. Hope it helps, -Randor (David Delaune)
-
Do you know what a message queue is?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
It is a thread specific message queue for GUI/non-GUI application. It stores the messages post by system or some other application.The thread retrieves the messages from its message queue using GetMessage or PeekMessage .If i m wrong somewhere pls rectify it.
never say die