The class hierarchy is CDialog -> BaseClass -> SubClass. BaseClass is abstract. Whenever an instance of SubClass is shown I want my BaseClass to capture the event and do something. This is the WM_SHOWWINDOW message.

I have the message handler registered in my base class, but not in my subclass. I figured the subclass would get the message, but not have a handler for it, so the base class method would take over and handle the message, but this doesn't seem to be happening. I could just capture the event in each subclass and then have it do BaseClass::OnShowWindow(), but that seems a little clunky to be doing that for each type of subclass. Also anytime someone forgot to add that to the subclass, it would break that mechanism. There has to be a better way. Any ideas?