"Go" on_message use method

Source: Internet
Author: User

On_message responds to custom messages, see the following steps for handling custom messages:
1. Define the message:

#define add Customize declaration to header file: afx_msg LRESULT Customize (WPARAM WPARAM, LPARAM LPARAM);

Registering the message in the 2.cpp file

On_message (Wm_customize, CUSTOMIZE)

3. Adding a message response function implementation
In the implementation file of the Ccdlg class, add the implementation part of the message response function, the code is as follows:

void ccdlg::customize (WPARAM WPARAM, LPARAM LPARAM) {     CString strtittle;     Strtittle.format (" Custom message parameters: x=%d,y=%d", Wparam,lparam);     SetWindowText (Strtittle); }

4. Explicitly send a message:
Add the "Custom Message" submenu to the main frame's help main menu, whose ID is set to id_customize, and the function name defaults by using the Class Wizard to respond to the command. The function body is as follows:

void cmainframe::oncustomize () {point    pos;      //     getcursorpos (&POS);     Pdlg-SendMessage (Wm_customize, (UINT) pos.x,pos.y);}

from:http://blog.163.com/zy_tommy/blog/static/869267772010222851391/

"Go" on_message use method

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.