SCROLLBAR Control

Scroll bars are basically slider controls. By themselves, they do no scrolling. The synchronization of the scroll bar and an image being scrolled must be programmed.
    The SCROLLBAR class is limited to displaying rectangular sliders.

[See Introduction to Controls]

Scroll bar types and styles

Scroll bar types:

SBS_HORZ   equ 0000h
SBS_VERT   equ 0001h

Scroll bar styles:
;
; Scroll Bar constants
;
SB_HORZ equ 0
SB_VERT equ 1
SB_CTL equ 2
SB_BOTH equ 3

SBS_TOPALIGN  equ 0002h
SBS_LEFTALIGN  equ 0002h
SBS_BOTTOMALIGN  equ 0004h
SBS_RIGHTALIGN  equ 0004h
SBS_SIZEBOXTOPLEFTALIGN equ 0002h
SBS_SIZEBOXBOTTOMRIGHTALIGN equ 0004h
SBS_SIZEBOX   equ 0008h
SBS_SIZEGRIP  equ 0010h

Scroll bar messages

Scroll bar messages:

;
; Scroll Bar Info flags
;
SIF_RANGE
SIF_PAGE
SIF_POS
SIF_DISABLENOSCROLL
SIF_TRACKPOS
SIF_ALL equ SIF_RANGE or SIF_PAGE or SIF_POS or SIF_TRACKPOS
;
; Scroll Bar messages
;
SBM_SETPOS
SBM_GETPOS
SBM_SETRANGE
SBM_SETRANGEREDRAW
SBM_GETRANGE
SBM_ENABLE_ARROWS
SBM_SETSCROLLINFO
SBM_GETSCROLLINFO

Scroll bar notifications

Vertical scroll bars notify their parents by sending a WM_VSCROLL message to them with a notification code. Horizontal scroll bars send a WM_HSCROLL message. (Unlike the other standard controls, these don't send WM_COMMAND messages.)

Scroll bar notification codes:
;
; Scroll Bar commands
;
SB_LINEUP
SB_LINELEFT
SB_LINEDOWN
SB_LINERIGHT
SB_PAGEUP
SB_PAGELEFT
SB_PAGEDOWN
SB_PAGERIGHT
SB_THUMBPOSITION
SB_THUMBTRACK
SB_TOP
SB_LEFT
SB_BOTTOM
SB_RIGHT
SB_ENDSCROLL