ListView is slow with many items


Id: 4089.9
Type: Issue Issue
Current Status: Open


29 May 2003 Open Greg Thomson

I have modified the listview so that I find the speed is MUCH faster. Basically equal to a non-subclassed listview in a C++ app. The problems I found with yours was:

1) When adding new items, it took forever: This was becuase you had a hook installed at the time:

2) When scrolling the list, the was very "rough" and jumpy. This was caused by the CUSTOM_DRAW being triggered under WM_NOTIFY.

What I did was:

I created 2 functions: BeginListPopulation and EndListPopulation

In BeginListPopuplation, I removed all of the hooks, and in endlistpopulation, I re-instated the hooks again. I am not exactly sure how your subclassing works, but I found that in order for it to work properly on the re-instating the hooks again, I did an On Error Resume Next, and then I attempt to re-instate the hooks 3 times. 2 times also seemed to work...but it didn't work for me I decided to just put it in there for the 3rd time for good measure. Since I am not doing contact list updates, I have found this to look MUCH better.

Also, since I am not doing any custom drawing, I trap code -12 (Custom Draw) if a WM_NOTIFY is passed to WndProc. If -12 is passed, I simply exit the function at that point. That has made my list scrolling WAY nicer.

20 Jun 2003 Open Steve McMahon

The CustomDraw flag can be used to switch Custom Draw on and off. Modified the custom draw function so it checks this flag earlier and so jumps out more quickly.