Windows Messaging mechanism

Source: Internet
Author: User
Tags case statement switch case
Windows Messaging mechanism

Windows is a message-driven operating system. such as drawing the window's message wm_paint.

Structure definition:

Message Classification-Send route

The queue message. Windows maintains a message queue for each running program, which is taken out by the application itself, such as Wm_timer.

Non-queue messages. Such messages come from a specific Windows function, such as the UpdateWindow () function, which sends a WM_PAINT redraw message directly to the window handler function.

Message Classification-Sender

System messages. is a predefined uint constant.

User messages. Apply through the RegisterWindowMessage () function.

Sending of messages

PostMessage (), an asynchronous function that is returned directly after it is placed in the queue.

SendMessage (), the synchronization function, does not enter the message queue, the execution is completed before returning.

Get the message

The API uses the switch case statement.

MFC is encapsulated with message maps. (Nature or API)

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.