Add the WM_HSCROLL and WM_VSCROLL cases to process scroll-bar messages. Add the following statements to the window function:
case WM_HSCROLL:
case WM_VSCROLL:
strcpy(HorzOrVertText,
(message == WM_HSCROLL) ? “WM_HSCROLL” : “WM_VSCROLL”);
strcpy(ScrollTypeText,
(wParam == SB_LINEUP) ? “SB_LINEUP” :
(wParam == SB_LINEDOWN) ? “SB_LINEDOWN” :
(wParam == SB_PAGEUP) ? “SB_PAGEUP” :
(wParam == SB_PAGEDOWN) ? “SB_PAGEDOWN” :
(wParam == SB_THUMBPOSITION) ? “SB_THUMBPOSITION” :
(wParam == SB_THUMBTRACK) ? “SB_THUMBTRACK” :
(wParam == SB_ENDSCROLL) ? “SB_ENDSCROLL” : “unknown”);
wsprintf(ScrollText, “%s: %s, %x, %x”,
(LPSTR)HorzOrVertText,
(LPSTR)ScrollTypeText,
LOWORD(lParam),
HIWORD(lParam));
InvalidateRect(hWnd, &rectScroll, TRUE);
break;