To make your application process scroll bar messages, add WM_HSCROLL and WM_VSCROLL cases to the window procedure, as follows:
case WM_HSCROLL:
case WM_VSCROLL:
wsprintf(ScrollText, "%s: %s, %x, %x",
(LPSTR) ((message == WM_HSCROLL) ? "WM_HSCROLL" :
"WM_VSCROLL"),
(LPSTR) ((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"),
ScrollTypeText,
LOWORD(lParam),
HIWORD(lParam));
InvalidateRect(hWnd, &rectScroll, TRUE);
break;