int GetScrollPos(hWnd,nBar)
This function retrieves the current position of a scroll-bar thumb. The current position is a relative value that depends on the current scrolling range. For example, if the scrolling range is 0 to 100 and the thumb is in the middle of the bar, the current position is 50.
Parameter | Type/Description |
hWnd | HWND Identifies a window that has standard scroll bars or a scroll-bar control, depending on the value of the nBar parameter. | ||
nBar | int Specifies the scroll bar to examine. It can be one of the following values: | ||
Value | Meaning | ||
SB_CTL | Retrieves the position of a scroll-bar control. In this case, the hWnd parameter must be the window handle of a scroll-bar control. | ||
SB_HORZ | Retrieves the position of a window's horizontal scroll bar. | ||
SB_VERT | Retrieves the position of a window's vertical scroll bar. |
The return value specifies the current position of the scroll-bar thumb.