I have a control derived from a CWnd object that has its custom implemented tooltip system . The tooltip is implemented using a CDialog and works fine but I have a problem to know when I have to hide it.
The tooltip shows up when the mouse hover over the control (WM_MOUSEHOVER) and it's hidden when the mouse leaves the control (WM_MOUSELEAVE). So far so good. The problem is that the dialog where the control is set can be hidden from the menu (not destroyed it can be displayed again from the menu). When this happens the WM_MOUSELEAVE event is not sent to the control and the tooltip is not removed...it appears over the new dialog.
My question is: is there a way to know that the control is being hidden? I know I can capture the WM_SHOWWINDOW message for the dialog where the control is set but I want to do it from the control itself so I can use the control elsewhere without having to add extra code.
Thanks in advance!
Javier