I am creating a app to take a screen shot of a scrolling window using C# .NET 4.
I have approached this by using WINAPI SendMessage with WM_MOUSEWHEEL to move down 1 line at a time and take a screen shot of each line.
To detect if I have reached the bottom I compare the last 2 images taken, if they are the same , I have reached the bottom.
The problem comes when the last WM_MOUSEWHEEL is not a full line.
For example:
Window is 95px high
each line is 10px
I will end up with 10 images each 10px high to splice but the last one is going to be too big which ends up duplicating (in this example) the area between 85 and 90px
Is there any other way using WINAPI to detect how many pixels has been scrolled or any other suggestions on the approach taken?
Look at
GetScrollPositionandGetScrollRangeI think those API calls can provide you with the information you need.