|
-
December 23rd, 2003, 08:53 PM
#1
Sorting and LVN_ITEMCHANGED
Hi gurus,
I create a class derived from CListCtrl. This class is like ListCtrl in Windows Explorer in Details View. You can create new file, rename, or delete, re-arrange, ....
Now I have a problem. My class do some jobs when LVN_ITEMCHANGED is notified. When I re-order the list, the OnItemChanged is called many times that is equal to the Item Count. This made me annoyed and wasted time. If anyone know how to re-order the list without notifiying LVN_ITEMCHANGED, please let me know. Thanks in advanced.
Ah, yeah, my class uses SortItems(...) function of CListCtrl to sort. Everything seems good except the above problem.
Quang
-
December 23rd, 2003, 08:56 PM
#2
One solution is a boolean variable to temporarily disable the work done inside the message handler.
Kuphryn
-
December 23rd, 2003, 09:14 PM
#3
Thanks kuphryn for your quick answer. Before posting, I tried this solution. But LVN_ITEMCHANGED is notified when sorting has been finished. I think that when SortItems is returned, CListCtrl have item list in the sorted order, then CListCtrl remove all current items and add items in the sorted list. Now this time LVN_ITEMCHANGED is notified when each item is added. Is this correct?
Quang
-
December 23rd, 2003, 10:09 PM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|