GetScrollBarInfo function (winuser.h)

The GetScrollBarInfo function retrieves information about the specified scroll bar.

Syntax

BOOL GetScrollBarInfo(
  [in]  HWND           hwnd,
  [in]  LONG           idObject,
  [out] PSCROLLBARINFO psbi
);

Parameters

[in] hwnd

Type: HWND

Handle to a window associated with the scroll bar whose information is to be retrieved. If the idObject parameter is OBJID_CLIENT, hwnd is a handle to a scroll bar control. Otherwise, hwnd is a handle to a window created with WS_VSCROLL and/or WS_HSCROLL style.

[in] idObject

Type: LONG

Specifies the scroll bar object. This parameter can be one of the following values.

Value Meaning
OBJID_CLIENT
The hwnd parameter is a handle to a scroll bar control.
OBJID_HSCROLL
The horizontal scroll bar of the hwnd window.
OBJID_VSCROLL
The vertical scroll bar of the hwnd window.

[out] psbi

Type: PSCROLLBARINFO

Pointer to a SCROLLBARINFO structure to receive the information. Before calling GetScrollBarInfo, set the cbSize member to sizeof(SCROLLBARINFO).

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

If idObject is OBJID_CLIENT and the window specified by hwnd is not a system scroll bar control, the system sends the SBM_GETSCROLLBARINFO message to the window to obtain scroll bar information. This allows GetScrollBarInfo to operate on a custom control that mimics a scroll bar. If the window does not handle the SBM_GETSCROLLBARINFO message, the GetScrollBarInfo function fails.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll
Redistributable Service Pack 6
API set ext-ms-win-ntuser-misc-l1-2-0 (introduced in Windows 8.1)

See also

SCROLLBARINFO