CListCtrl::GetTopIndex on KeyDown
Posted on 2004-10-19
I need to know the top index which is visible in the list control. For that I use CListCtrl::GetTopIndex().
But when I hook a function LVN_KEYDOWN for this list control. It always returns me 0. Basically I need to process something when the top index of the list control changes.
When the user uses mouse and scrollbar to scroll, GetTopIndex() works as expected. But on keydown or selection via mouse on a particular row it does not always return me the right TopIndex.
Observation made when I hit down arrow key GetTopIndex() returns me always 0. But when I hit up arrow key it returns me the right index.