Procedure for a VC window to send messages to other windows

Source: Internet
Author: User
In a project, the subwindow needs to upload different status information to other windows for different display.
The main implementation process is:

1. Set the window handle of other windows to global and assign values during initialization;
Hwnd hmainwnd;
Hmainwnd = This-> getsafehwnd ();

2. customize messages and add response functions in other windows;
Add in resource. h
# Define wm_mymessage (wm_user+ 100)

Class
Afx_msg void onmymessage (wparam, lparam); Function and Its Implementation

Add a message to the Message ing to correspond to the message processing function.
Begin_message_map (cwebdlgdlg, cdialog)
// {Afx_msg_map (cwebdlgdlg)
On_message (wm_mymessage, mymessage)
//} Afx_msg_map
End_message_map ()

3. Send messages in the subwindow

: Sendmessage (hmainwnd, wm_mymessage, 10l, 5l );

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.