I'm trying to write my own scrollbar in the nonclient area using a NativeWindow, and everything is working fine except for mouse messages. It seems to have something to do with WM_NCHITTEST, but there isn't a proper response to return from it that gives the same behavior as Windows scrollbars. I tried returning HTVSCROLL and HTHSCROLL, but then I don't receive any mouse movement messages once I click on the non client area, which doesn't allow me to drag the bar. I tried HTCLIENT but then I can still interact with my controls via hot tracking because normal WM_MOUSEMOVE messages are still being sent, which is undesirable.
If there isn't a way to use WM_NCHHITTEST to make the mouse messages go through properly, what is the way?