GetScrollRange

2.x

  void GetScrollRange(hwnd, fnBar, lpnMinPos, lpnMaxPos)    
  HWND hwnd; /* handle of window with scroll bar */
  int fnBar; /* scroll bar flags, */  
  int FAR* lpnMinPos; /* receives minimum position */
  int FAR* lpnMaxPos; /* receives maximum position */

The GetScrollRange function retrieves the current minimum and maximum scroll bar positions for the given scroll bar.

Parameters

hwnd

Identifies a window that has standard scroll bars or a scroll bar control, depending on the value of the fnBar parameter.

fnBar

Specifies which scroll bar to retrieve. This parameter 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 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.

lpnMinPos

Points to the integer variable that receives the minimum position.

lpnMaxPos

Points to the integer variable that receives the maximum position.

Return Value

This function does not return a value.

Comments

If the given window does not have standard scroll bars or is not a scroll bar control, the GetScrollRange function copies zero to the lpnMinPos and lpnMaxPos parameters.

The default range for a standard scroll bar is 0 through 100. The default range for a scroll bar control is empty (both values are zero).

See Also

GetScrollPos, SetScrollPos, SetScrollRange