views:

144

answers:

0

I have a CListCtrl derived class that provides subitem editing by creating a CEdit starting at the correct offset of the subitem. Sometimes the subitem is only partially visible so I scroll the CListCtrl to the offset location to gain more space for the CEdit.

Now something very weird happens: On Windows Vista and Windows 7 the CListCtrl is scrolled back automatically to its initial scrolling position after a short delay (it doesn't happen on Windows XP). I noticed that this happens right after a WM_TIMER message was sent to the CListCtrl with the event ids 42 or 43.

For the moment I discard these messages in case the CListCtrl is in editing mode, but I feel a little bit bad with this workaround, mostly because I don't understand why these timer messages are sent, why they trigger this automatic scrolling, and whether they're actually needed.

Thanks for any light you can shed on this.