How to Get and Process Control Messages in MFC, such as cbutton onmousemove

Source: Internet
Author: User
Please first understand the concepts of the following superclasses and subclasses. In MFC, in addition to subclassdlgitem, there are also subclasswindow functions used to execute the same functions. After associating with a control ID, all messages of the control will have this class to respond. Generally, the process is as follows: 1. A class is derived from the control that wants subclass, for example, cedit-> cmyedit; 2. messages to be processed, such as onchar, are completed in cmyedit; 3. Define the member variable m_myedit of the cmyedit class in the dialog box class; 4. Add m_myedit (idc_edit, this) to the oninitdialog of the dialog; in this way, when onchar occurs on idc_edit, the onchar in cmyedit will be called.

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: 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.