I have succeeded sor far. My scrollbar is always painted the way I
want, except for one time. When I click on the scollbar's thumb and
start tracking (dragging) it, it will paint the default windows gray
scrollbar channel and thumb.
I looked with Spy++ and here is what I saw:
- When I left click on the scrollbar's thumb, the list control sens a
WM_NCLBUTTONDOWN, a WM_VSCROLL and a WM_CAPTURECHANGED.
- Then when I move the mouse, it will post WM_MOUSEMOVE that my
WindowProc will not catch. If I scroll enough to make the list scroll
by one item, I get the WM_VSCROLL, handle the paint and it's fine.
It's those "Damn" posted WM_MOUSEMOVE that I can't get a hold off. I
checked in Spy++ and the parent window does not get the message
either.
The best way to reproduce this is by clicking the scrollbar and moving
the mouse pointer far away from the list control to the right so it
doesn't scroll anymore. At that time, in Spy++, the only messages you
will see while moving the mouse will be posted WM_MOUSEMOVE (but never
received).
My guess is that when you start to drag the scrollbar and the mouse
capture is taken by the list control, somehow it never receives the
WM_MOUSEMOVE message. Could it be because the original click was in
the non client area? Or better, in the scrollbar portion of the
non-client area?
Can you help? If I fix this, my controls will look good all the time
:)
That's what I'd assume too.
Could you install a message hook and handle the message there?
Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
"David Lowndes" <dav...@mvps.org> wrote in message
news:2tlr8v8mg6ight7g9...@4ax.com...
Use the SetWindowsHookEx API. I think WH_MSGFILTER or WH_GETMESSAGE
are what you'll need. Also, have a look at the article "Win32 Hooks"
in MSDN.
Finally window controls with a new look, very little code and while keeping
a great OO design.
Keep on the good work guys. I'll drink one for you tonight David :)
"David Lowndes" <dav...@mvps.org> wrote in message
news:6puv8v8q4814o41tq...@4ax.com...