Scroll bar returns after WM_VSCROLL

I have a window with my scrolls H and V. I handle the event as follows:

case WM_VSCROLL:

        SetScrollPos(hWnd, SB_VERT, (int)HIWORD(wParam), TRUE);

        break;

all I want is the position of the scrollbar to stay when I release my mouse, but what it does is simply return to the top after. What am I doing wrong?

thank

+3
source share
2 answers

The parameter wParammessage WM_VSCROLLis set to SB_TOP, SB_BOTTOM, SB_PAGEUP, SB_PAGEDOWN, SB_LINEUP, SB_LINEDOWN, SB_THUMBPOSITIONor SB_THUMBTRACK, where the names have to explain themselves.

  • SB_TOP SB_BOTTOM , . , "" "". (, " Windows", "Win XP +" ).

  • SB_PAGEUP SB_PAGEDOWN () . , somwhere .

  • SB_LINEUP SB_LINEDOWN , .

  • SB_THUMBTRACK , , .

  • SB_THUMBPOSITION , .

. MSDN WM_VSCROLL.

, WM_VSCROLL, . , , , , ​​ . , SetScrollInfo, SetScrollPos.

+10

case WM_VSCROLL. SetScrollPos . . , SetScrollPos , . , SetScrollPos , , , , SetScrollPos.

0

Source: https://habr.com/ru/post/1745646/


All Articles