Getting mouse move events in a derived CStatic control?
Posted on 1997-05-12
I am writing something that I want to look like the colour selector in the windows NT(95) control panel - you know the one, a button with a colour on, and when you click on it, a little dialog drops down, allowing you to select the colour you want.
I have the button working (Owner Draw CButton), but the dialog is giving some problems. By examining desk.cpl in NT, I see the dialog uses an owner-draw text (CStatic) control. Fine, I thought, I'll just do the same.
My problem is that I need to trap mouse-clicks and mouse-moves. Clicks don't seem to get through (unlike CButton controls), and neither CButton nor CStatic send through mousemoves. I need these to highlight the colour and to select the colour, in the same way they do it in Control Panel.
Spy++ shows that the control gets WM_NCIHITTEST messages, but trapping OnNcHittest() doesn't ever seem to get called.
Help! - Am I doing something wrong / do MS do something Mystic to get this to work? I *really* don't want to go through the hassle of creating a custom control for this...