XPGetTrackMetrics

WIDGET_API void       XPGetTrackMetrics(
                         int                  inX1,
                         int                  inY1,
                         int                  inX2,
                         int                  inY2,
                         int                  inMin,
                         int                  inMax,
                         int                  inValue,
                         XPTrackStyle         inTrackStyle,
                         int *                outIsVertical,
                         int *                outDownBtnSize,
                         int *                outDownPageSize,
                         int *                outThumbSize,
                         int *                outUpPageSize,
                         int *                outUpBtnSize);

This routine returns the metrics of a track. If you want to write UI code to manipulate a track, this routine helps you know where the mouse locations are. For most other elements, the rectangle the element is drawn in is enough information. However, the scrollbar drawing routine does some automatic placement; this routine lets you know where things ended up. You pass almost everything you would pass to the draw routine. You get out the orientation, and other useful stuff.

Besides orientation, you get five dimensions for the five parts of a scrollbar, which are the down button, down area (area before the thumb), the thumb, and the up area and button. For horizontal scrollers, the left button decreases; for vertical scrollers, the top button decreases.