Sets the current position of a scrollbar control programmatically.
Takes scrollbarID (Int) and pos (Int).
Returns nothing.
BGI GUI
Parameters & Returns
Parameters
scrollbarIDInt
posInt
Returns
Void
Quick Summary
Sets the current position of a scrollbar control programmatically.
Takes scrollbarID (Int) and pos (Int).
Returns nothing.
Technical Exegesis...
Sets the current position of a scrollbar control programmatically. Searches gizmoMap for scrollbarID. If found, gets CustomScrollbarData* via GetWindowLongPtr(GWLP_USERDATA). Sets data->currentPos=pos. Clamps position to range: if currentPos < minVal, sets to minVal; if currentPos > maxVal, sets to maxVal. Calls InvalidateRect to trigger scrollbar redraw. No return value.
This function programmatically moves the scrollbar thumb to a specific position.
Sets the current position of a scrollbar control programmatically. Searches gizmoMap for scrollbarID. If found, gets CustomScrollbarData* via GetWindowLongPtr(GWLP_USERDATA). Sets data->currentPos=pos. Clamps position to range: if currentPos < minVal, sets to minVal; if currentPos > maxVal, sets to maxVal. Calls InvalidateRect to trigger scrollbar redraw. No return value.
This function programmatically moves the scrollbar thumb to a specific position. Automatic clamping ensures position stays within valid range [minVal, maxVal]. InvalidateRect triggers WM_PAINT to update visual appearance. Does not fire scroll events (events only fire from user interaction). Use for programmatic scrolling, initializing positions, or synchronizing multiple scrollbars. Works with both vertical and horizontal scrollbars. Common pattern: scroll content, then call bgiSetScrollbarPos to update scrollbar to match.