VC + + Deep Detailed reading Notes-sixth chapter menu

Source: Internet
Author: User

1.MFC all use uppercase letters to identify the resource ID number.

2. A variety of resources are used in the program, in order to clearly differentiate the resource type when determining its ID number, the principle is generally followed: after the "id" string and a letter identifying the resource type, for example, the ID number we set for the menu item is the "id" character followed by a letter "M", Indicates that this is the menu, which is the resource for the resource, the cursor resource, whose ID number is added with a letter "C" after the "id" string, and so on.

3. MessageBox function of the application framework: AfxMessageBox

int AfxMessageBox (LPCTSTR lpsztext,uint nType = mb_ok,uint nidhelp = 0);

Classification of 4.WINDOWS messages

(1) Standard message

All messages beginning with WM_ are standard messages, except for WM_COMMAND. Classes derived from CWnd can receive this type of message.

(2) Command message

Messages from menus, accelerator keys, or toolbar buttons. This type of message is presented in wm_command form. In MFC, different command messages are distinguished by the identification (ID) of the menu item, which is identified by the wparam parameter of the message in the SDK. A class derived from CCmdTarget can receive this type of message.

(3) Notification message

Messages generated by the control, such as the click of a button, the selection of a list box, and so on, produce such messages in order to notify their parent window (usually a dialog box) of the occurrence of the event. This type of message is also presented in wm_command form. A class derived from CCmdTarget can receive this type of message.

5. Since the CWnd class derives from CCmdTarget, any class derived from CWnd can receive both standard messages and command messages and advertisement messages. For classes that derive from CCmdTarget, you can only receive command and advertisement messages, and you cannot receive standard messages .

6.

VC + + Deep Detailed reading Notes-sixth chapter menu

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.