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 !!!!!!