I've tested a c++ version of this code in a subclassed WC_LISTBOX with >64k items & it seems to work fine.
Dragging the thumb scrolls the items from first to last with no jumping about & all items appear correct, have i missed something ?