There is a form and a panel on it. How to make so that at handling WM_NCHITTEST on panel the value for the form was returned. Ie, when WM_NCHITTEST is processed on the panel, then the message HTCAPTION should be returned for the form?
1 answer
You can try to intercept WM_NCHITTEST
at the panel and return the code TRANSPARENT
. This code means that "mouse input" on this control becomes "transparent". That is, theoretically, in this case, the form should take WM_NCHITTEST
even if the mouse is over the panel.
ps: in continuation of the discussion of the previous question
- @mega, thanks, it works. The last question remains: If we admit there is no possibility to process the message that is passed to the WndProc method, then you need to directly use the CallWindowProc function? - cyber_ua
- Regarding
CallWindowProc
: I didn’t quite understand what to do withCallWindowProc
. Do you mean that you would like to process some messages of the child components as if they came to the form itself? In such cases, there are 2 tools: 1. component notifications 2. subclassing. In the first case, most components have the ability to notify the "form" about some of their activity (for example, viaWM_COMMAND
orWM_NOTIFY
). In the second case, you can rewrite the procedure of the component window to control or change the processing of some messages of this component. - mega - ps: alas - the rules of the forum does not allow to give extended answers in the comments. If such questions arise, ask them separately, in
Q&A
format, so as not to limit the number and quality of answers. - mega - "You mean that you would like to process some messages of the child components as if they came to the form itself?" No, I have a class (inherits Control), it has a panel that is a new title bar, and I'm trying to do something like libraries, and that means I won't be able to add my code to wndProc. ps "ask them separately, in Q & A format, so as not to limit the number and quality of answers" and how to do it? - cyber_ua
- > and I am trying to do something like libraries, and that means I can’t add my code to wndProc I don’t understand this place. > how to do it? Just as you did, asking the question: "Return the message from one window to another." The main thing - describe in more detail the problem. - mega
|