Windows Messaging Mechanism

Source: Internet
Author: User

Windows is based on a message-driven system that provides system Message Queuing in order to hold messages.

Working principle:

The system will generate the corresponding message and put it into the message queue when monitoring the occurrence of the event. Each Windows application also has its own message queue. When a system message queue is processed, messages belonging to the application are posted to the appropriate message queue. The message loop constantly extracts messages from the message queue. distributed to the corresponding form procedure function to handle.


Such as:

650) this.width=650; "Style=" background-image:none;border-right-width:0px;border-top-width:0px; border-bottom-width:0px;border-left-width:0px;padding-left:0px;padding-right:0px;padding-top:0px; "Title=" O_ Windowsmessage2 "alt=" O_windowsmessage2 "src=" http://images.cnblogs.com/cnblogs_com/ztercel/201107/ 201107221202237414.jpg "border=" 0 "height=" 225 "width=" 473 "/>


To implement message loop mode:

1. Wait mode-Program hangs when no messages are in the queue

2. Non-wait mode – the program does not hang when there is no message in the queue

There are two different ways to differentiate:

The difference is that when there is no message in the message queue, you continue to wait for the message to work or continue to do something else.

This article is from the "None" blog, please be sure to keep this source http://evely.blog.51cto.com/1089422/1637968

Windows Messaging Mechanism

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.