MFC message transmission Sequence

Source: Internet
Author: User

1. afxwndproc () This function is used to receive messages, locate the cwnd object to which the message belongs, and then call afxcallwndproc.

2. afxcallwndproc () This function is used to save messages (the content mainly contains message identifiers and message parameters) for future use,
Then call the windowproc () function.

3. windowproc () this function is responsible for sending messages to the onwndmsg () function. If not processed, call the defwindowproc () function.

4. onwndmsg () This function first sorts messages by byte. For wm_command messages, oncommand () messages are called.
Response Function for wm_notify messages
Call the onnotify () Message response function. Any missed message is a window message. Onwndmsg () function search
To find
The processing function that can process any window message. If the onwndmsg () function cannot find such a processing function
Returns a message to the windowproc () function, which sends the message to the defwindowproc () function.

5. oncommand () This function checks whether this is a control notification (the lparam parameter is not null. If the lparam parameter is null, it indicates
The message is not a control notification). If it is, the oncommand () function tries to map the message to the control that creates the notification;
If it is not a control notification (or if the control rejects the ing message) oncommand (), the on1_msg () function will be called.

6. Based on the class that receives messages, the onreceivmsg () function is potentially used in a process called command routing.
Send command messages and control notifications.
For example, if the class that owns the window is a framework class, the command and notification messages are also transmitted to the view and document class for
Class to find a message processing function

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.