G
Guest
I want to force a window to scroll and am finding this to be an impossibly difficult task. First I tried using the API functions ScrollWindow and ScrollWindowEx but they do not work. The portion that is being exposed in the scroll is not painting properly even though I've passed it the flags to tell it to invalidate and erase the new area's background. Then when I force the window to redraw by covering the window with another app the window is redrawn in its original position.
I was then led down the path of calling SetScrollPosition on my window but this doesn't work either. The contents of the window are not redrawn and it's difficult to convert the number of actual pixels I want to scroll by into the generally larger min/max range of the scrollbar. Even after I add code to cause the scroll the scrollbar works great but the contents of the window do not move. Then eventually I get to the point where tapping the scrollbar arrows itself will cause the window to jump dramatically to another point.
From what I can tell there's absolutely no communication between a window and its internally-created scrollbar and that causes these API calls to fail. So I then tried to do both a SetScrollPos and a ScrollWindow and I didn't have anymore luck.
Since the act of manually scrolling a window is not documented in the MSDN or even mentioned in the newsgroups I'm starting to think that my desired behavior is not something applications are not supposed to handle on their own. If this is true how do I cause a window automatically when the user drags content to the upper or lower portion of the window like so many other apps do?
Thanks
I was then led down the path of calling SetScrollPosition on my window but this doesn't work either. The contents of the window are not redrawn and it's difficult to convert the number of actual pixels I want to scroll by into the generally larger min/max range of the scrollbar. Even after I add code to cause the scroll the scrollbar works great but the contents of the window do not move. Then eventually I get to the point where tapping the scrollbar arrows itself will cause the window to jump dramatically to another point.
From what I can tell there's absolutely no communication between a window and its internally-created scrollbar and that causes these API calls to fail. So I then tried to do both a SetScrollPos and a ScrollWindow and I didn't have anymore luck.
Since the act of manually scrolling a window is not documented in the MSDN or even mentioned in the newsgroups I'm starting to think that my desired behavior is not something applications are not supposed to handle on their own. If this is true how do I cause a window automatically when the user drags content to the upper or lower portion of the window like so many other apps do?
Thanks