Search code examples
c++winapiwindows-messages

WM_COMMAND not passed to main window


I would like to place an edit control (WC_EDIT) on a static control (WC_STATIC). Unfortunately, when I do that I don't receive any WM_COMMAND messages from the edit control in the windows callback function. Is it somehow possible to tell the static control to forward those messages to its parent?

Thank you very much for your help!


Solution

  • If I understand correctly, the parent of the edit control is the static control. If this is the case, you will need to subclass the static control using SetWindowLongPtr with the GWLP_WNDPROC flag and then forward the message to where ever you want it.