Export (0) Print
Expand All

GetScrollBarInfo function

The GetScrollBarInfo function retrieves information about the specified scroll bar.

Syntax


BOOL GetScrollBarInfo(
  _In_   HWND hwnd,
  _In_   LONG idObject,
  _Out_  PSCROLLBARINFO psbi
);

Parameters

hwnd [in]

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.

idObject [in]

Type: LONG

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

ValueMeaning
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.

 

psbi [out]

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

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Redistributable

Service Pack 6

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

SCROLLBARINFO

 

 

Community Additions

ADD
Show:
© 2014 Microsoft