Flickering list control
-
I am updating a list control with several operations, including deleting some entries and adding others. Due to the speed at which the new entries must be made, I have found that I need to do a SetDraw(FALSE) prior to adding and removing the entries to ensure that all of the time critical messages that are the basis of the entries are entered and none are missed. Although I am now catching all of the messages, I now find that the list control constantly flickers irritatingly. Is there a way to prevent this flickering? Any ideas are appreciated. Thanks.:)
-
I am updating a list control with several operations, including deleting some entries and adding others. Due to the speed at which the new entries must be made, I have found that I need to do a SetDraw(FALSE) prior to adding and removing the entries to ensure that all of the time critical messages that are the basis of the entries are entered and none are missed. Although I am now catching all of the messages, I now find that the list control constantly flickers irritatingly. Is there a way to prevent this flickering? Any ideas are appreciated. Thanks.:)
What messages are you catching? What does it have in common with blocking the redraws of list control? Tomasz Sowinski -- http://www.shooltz.com
-
What messages are you catching? What does it have in common with blocking the redraws of list control? Tomasz Sowinski -- http://www.shooltz.com
The messages are from a queue that is being populated by a program that is external to my application. Essentially, the program is on a network and maintains its own queue of the messages that are being sent on the network. When a message is processed, it is removed from the queue. My application taps into the queue and dumps each entry one-by-one into the list control. Since my app maintains a max size for the list control, when an entry is added to the list control, if it is at the max size, it will first delete the oldest entry and then add the new entry. The reason for the SetRedraw was that the list control was being redrawn both after the delete and the add. The messages in the other application are so quick that my app was missing messages because of this extra redraw. Now, I no longer miss the messages, but the screen flickers. Any ideas?:confused:
-
The messages are from a queue that is being populated by a program that is external to my application. Essentially, the program is on a network and maintains its own queue of the messages that are being sent on the network. When a message is processed, it is removed from the queue. My application taps into the queue and dumps each entry one-by-one into the list control. Since my app maintains a max size for the list control, when an entry is added to the list control, if it is at the max size, it will first delete the oldest entry and then add the new entry. The reason for the SetRedraw was that the list control was being redrawn both after the delete and the add. The messages in the other application are so quick that my app was missing messages because of this extra redraw. Now, I no longer miss the messages, but the screen flickers. Any ideas?:confused:
Maybe you should switch into virtual list mode (LVS_OWNERDATA style) - you'd keep the strings in your own data structures and list would notify you that it needs repainting. You could even move message retrieval/storing into separate thread. Tomasz Sowinski -- http://www.shooltz.com
-
Maybe you should switch into virtual list mode (LVS_OWNERDATA style) - you'd keep the strings in your own data structures and list would notify you that it needs repainting. You could even move message retrieval/storing into separate thread. Tomasz Sowinski -- http://www.shooltz.com
I currently have the message retrieval in a separate thread. I have reservations about changing the structures being used; the application currently works and has gone through the testing process and a structural change would mean more retesting time than is allotted for the project. If you know of any other way, I would really appreciate it. I was kinda hoping that you would tell me about the little known "StopFlickering()" method.;) Thanks a lot.