Hello

I'm using Win32 API - Visual C and use and catch messages from
scrollbars that i use with my main window. The problem is that once i
move the scroll thumb it jumps back to 0 when i release it. Why is
that? How can this be fixed?

Here is how i tried, but still jumps back to zero:

case WM_HSCROLL:
{
int nScrollCode = (int)LOWORD(wParam);
int nPos = (short int)HIWORD(wParam);

if (nPos != 0);
nTest = SetScrollPos(hWnd, SB_HORZ, nPos, TRUE);

nHPosition = nPos;
InvalidateRect(hWnd, NULL, false);
}
break;

Thanks

Re: Windows ScrollThumb Problem by grubbymaster

grubbymaster
Wed Jan 17 04:10:59 CST 2007

Srry for the topic. I figured it out eventually using SB_THUMBPOSITION:
:

case WM_VSCROLL:
{
int nScrollCode = (int)LOWORD(wParam);
int nPos = (short int)HIWORD(wParam);


if (bAM == false)
{
nVPosition = nPos;
InvalidateRect(hWnd, NULL, false);
}


bAM = false;


switch (nScrollCode)
{
case SB_THUMBPOSITION:
{
sVPos = HIWORD (wParam);
SetScrollPos(hWnd, SB_VERT,
sVPos, TRUE);


nThumbVPosition = sVPos;
bAM = true;
InvalidateRect(hWnd, NULL,
false);
}
break;
}
}
break;