How to get the Track position of a Scrollbar while scrolling

The problem

We wanted to get the track position of the horizontal scrollbar of a FlowLayoutPanel while scrolling.
To get the horizontal scroll position we could get the FlowLayoutPanel.HorizontalScroll.Value property.
However, its value does not change while we are actually scrolling the panel but its value changes only after we stopped scrolling and the
left mouse button is up.
To get the track position of the scrollbar in the Scroll Event of the FlowLayoutPanel we need little API.

Solution

We are going to use the API function GetScrollInfo to get the Track position of the scrollbar.
At first add "using System.Runtime.InteropServices;" to the header of your class.
The required API functions and structures are the following :