Windows Messaging mechanism

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

Windows is a message-driven operating system.

such as the message wm_paint the form is drawn.

Structure definition:

Message Classification-Send route

The queue message.

Windows maintains a message queue for each program that executes. Taken out by the application itself, such as Wm_timer.

Non-queue messages.

This type of message comes from a specific Windows function, such as the UpdateWindow () function, which sends a WM_PAINT redraw message directly to the form handler function.

Message Classification-Sender

System messages. is a uint constant that is defined in advance.

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 run is complete before returning.

Get the message

The API uses the switch case statement.

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

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.