Understand Windows message announcement messages and command messages !!!

Source: Internet
Author: User

I used some things in my work today, and further explored the message mechanism of windows !!!!

My findings are as follows:

In my project, I need to dynamically create static controls on the composite controls in ATL and be able to drag them !!!

The order in which the notification messages of the control are delivered is involved !!

When I intercept STN_CLICKED in the parent window. Then, the original window process was replaced when the static window was created, so that all the static window processes point to my own window process, where I intercepted the message WM_LBUTTONDOWN, after intercepting the message, I did not process the original window process. Then I found that the STN_CLICKED message intercepted in the parent window cannot respond! At this time, I realized that the so-called WM_COMMAND and WM_NOTIFY messages are only converted from standard messages in windows !!!

I guess the message WM_LBUTTONDOWN has been converted in the previous window process, and then the STN_CLICKED message is sent to the parent window, and the response parameters are passed in !!!!!!!!!

Why does windows do this ????

I think there are the following reasons:

First of all, all windows common contrl have received windows Standard Messages. However, due to the differences in controls, we should differentiate them for different controls!

Furthermore, different controls have different functions. Therefore, the standard message is converted into a responding wm_y y WM_COMMAND message and sent to the parent window, giving the parent window a chance to process the child window!

 

Third, after the message is modified, some data structures for corresponding controls are defined in the message, in this way, the data structure transmitted through this message is conducive to our own operations on this control !!!!

 

 

Fourth, I did not expect it !! O (∩ _ ∩) O ~!!!!!!

If something is wrong, please give me some advice !!!!!!

 

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.