Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WM_VScroll and SB_ThumbTrack code

195 views
Skip to first unread message

saurabh khanna

unread,
Nov 13, 2000, 3:00:00 AM11/13/00
to

Hi,

I am trying to implement deferred scrolling (like win3.11) in a virtual
listview control I have made. Reason why I want to do this is that I have to
do some hairy computations when dragging the scroll bar so I wnat to do it
only when the user stops dragging the scrollbar.

I eat up the SB_THUMBTRACK code sent to the Listview in the WM_VScroll
message, and try to handle the SB_THUMBPOSITION message(again sent as
WM_VScroll). [[[ The SB_THUMBPOSITION signifies that user has stopped
scrolling and gives me the nPos as the position of the scroll bar.]]]

However, I am trying to find a relation between the nPos and the actual
ListItem which should be made visible for this nPos so I can manually
repopulate the ListView to show that item.

Any idea if there is a relation between nPos and the listitem number.

Here is the code I use to get all this :

Case WM_VSCROLL
Select Case LOWORD(wParam)
Case SB_THUMBTRACK
CancelMessage = True
Case SB_THUMBPOSITION
'Now since the thumb position message is being sent, I will
need to track what is the current
'position of hte scroll bar
npos = HIWORD(wParam)

'NOW how to handle this thumbposition message to set the
scroll bar correctly and bring the correct item into focus.

Thanks a lot for any help

Saurabh
Software Design Engg.
MicroStrategy.


saurabh khanna

unread,
Nov 13, 2000, 3:00:00 AM11/13/00
to
Sorry, but I found the answer myself.

Actually, the question is wrong. Using the GetScrollInfo API, I found that
the nPos part of the wParam actually tells me which listitem is to be made
visible. So if there are 100 items in a listview, the min position of the
scroll bar is 0 and max is 99.

Answer, there is already a one to one mapping between the scroll bar and the
listitems.

Cool !!!

Saurabh K
MicroStrategy.


"saurabh khanna" <skha...@hotmail.com> wrote in message
news:uaE2tMbTAHA.261@cppssbbsa04...

0 new messages