Can't do PostMessage() with SB_THUMBPOSITION

Why doesn't PostMessage() work with
SB_THUMBPOSITION? Example:

mylistctrl.PostMessage(WM_VSCROLL,\
MAKEWPARAM(SB_THUMBPOSITION,mylistctrl.GetTopIndex() +1, NULL); // fails

I can do post WM_VSCROLL for notifications of SB_PAGEUP/DOWN/LINEUP/DOWN but not for SB_THUMBTRACK.

I have a real problem where I need to
post or send SB_THUMBPOSITION notification.
kkrueckeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kkrueckeAuthor Commented:
Edited text of question.
0
Tommy HuiEngineerCommented:
Most likely the reason is the control has not seen a WM_LBUTTONDOWN message. Usually, most windows will maintain a flag that tells them whether the mouse button is up or down. If it is down, then they will respond to particular messages. If not, then they won't. I bet SB_THUMBPOSITION would be one of them. So the sequence to try is

  PostMessage(WM_LBUTTONDOWN, ...);
  PostMessage(WM_VSCROLL, ...);
  PostMsesage(WM_LBUTTONUP, ...);
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kkrueckeAuthor Commented:

Thanks for your answer. I believe you are correct, windows is keeping track of whether the scrollbar button is down.

I will test your solution.  I wonder: if I send WM_LBUTTONDOWN, do I then have to send WM_MOUSEMOVE?

Anyway, what I am really trying to accomplish is, scroll two adjacent list view controls using only one scrollbar, the the scroll bar would be attached to the right-most control.  This is a product requirement.  I have a OnVScroll() handler, and in it I do the SendMessage() to the other list view control. For case SB_THUMBTRACK, I send WM_LBUTTONDOWN, won't the focus change to the other list view control?  
I guess, I have to try alternating the focus--after I test your proposed solution.

regards,
Kurt
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.