VC ++ detailed description of Reading Notes-Chapter 6 menu, vc Reading Notes

Source: Internet
Author: User

VC ++ detailed description of Reading Notes-Chapter 6 menu, vc Reading Notes

1. MFC uses uppercase letters to identify the resource ID.

2. multiple resources are used in the program. When determining its ID number for the resource, in order to clearly distinguish the resource type, this principle is generally followed: add a letter to the end of the "ID" string to identify the resource type. For example, we add a letter "M" after the "ID" character to the menu item ", it indicates that this is a Menu, that is, a Menu resource, a Cursor resource, and its ID number is a "C" after the "ID" string.

3. The MessageBox function of the application framework: AfxMessageBox

Int AfxMessageBox (LPCTSTR lpszText, UINT nType = MB_ OK, UINT nIDHelp = 0 );

4. Windows message Classification

(1) Standard Messages

All messages starting with WM _ are standard messages except WM_COMMAND. SlaveCWndThe derived class can receive such messages.

(2) Command Message

Messages from menus, acceleration keys, or toolbar buttons. Such messages are displayed in the form of WM_COMMAND.In MFC, different command messages are distinguished by the menu item ID. In SDK, The wParam parameter of the message is used to identify messages.. SlaveCsf-targetThe derived class can receive such messages.

(3) Announcement

Messages generated by the control, such as Button clicking and selection of the list box, are generated to notify the event to its parent window (usually a dialog box. Such messages are also presented in the form of WM_COMMAND. Classes derived from csf-target can receive such messages.

5. Because the CWnd class is derived from c1_target,Classes derived from CWnd can receive standard messages, command messages, and notification messages. For Classes derived from csf-target, only command messages and advertised messages can be received, and standard messages cannot be received..

6.

Related Article

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.