Windows message processing mechanism

Source: Internet
Author: User

Three-layer mechanism

1. The top is the Windows kernel. The Windows kernel maintains a message queue, and the second-level control center obtains its own jurisdictional messages from this message queue, processes them, some messages are processed directly, and some are sent to the next Level form (Window) or control

2. The second level control center is typically the application object for each Windows application

3. The third-level control center is a Windows Forms object, and each form has a default form procedure that handles the various messages received

1 • Message Queuing. Windows can maintain a message queue for all applications. The application must obtain a message from the message queue and then assign it to a window. 2 • Message loops. Through this loop mechanism the application retrieves the message from the message queue, assigns it to the appropriate window, and proceeds to retrieve the next message from the message queue, then assigns it to the appropriate window, in turn. 3 · Window procedure. Each window has a window procedure to receive the message that is passed to the window, and its task is to get the message and then respond to it. A window procedure is a callback function; After a message is processed, it usually returns a value to Windows. Note that a callback function is a function in a program that is called by a Windows or external module.

Windows message processing 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.