home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4897 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.9 KB  |  45 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!agate!ames!pacbell.com!charon.amdahl.com!netcomsv!delfin.com!dan
  3. From: dan@delfin.com (Dan Stickel)
  4. Subject: Re: LB_ADDSTRING Redrawing 
  5. Message-ID: <1993Jan12.222639.19974@delfin.com>
  6. Organization: Delfin Systems
  7. X-Newsreader: Tin 1.1 PL4
  8. References: <726546452snz@chrism.demon.co.uk>
  9. Date: Tue, 12 Jan 1993 22:26:39 GMT
  10. Lines: 33
  11.  
  12. chris@chrism.demon.co.uk (Chris Marriott) writes:
  13. : In article <1993Jan9.011837.22185@delfin.com> dan@delfin.com writes:
  14. : >I have created an owner draw listbox.  Is there any way to prevent
  15. : >the listbox from redrawing all visible items when it scrolls one line 
  16. : >after receiving an LB_ADDSTRING message?  Without the LB_ADDSTRING,
  17. : >scrolling only redraws the newly visible item, doing a quick bitmap
  18. : >shift of the other items.
  19. : >
  20. : >I have tried everything I could think of.  At this point, it seems
  21. : >to me that there is no way to avoid it.
  22. : >
  23. : >
  24. : Send the listbox a WM_SETREDRAW, FALSE message.  Add all the strings
  25. : except the last one.  Send WM_SETREDRAW, TRUE.  Add the last string.
  26. : -- 
  27. :  
  28.  
  29. I appreciate the responses, but my question is actually much more
  30. sophisticated.  I know all about WM_SETREDRAW.  I want to append one
  31. line to the listbox and have it visible.  No matter how I get it 
  32. to be visible (SCROLL,SETPOS,etc.), all my visible owner draw lines
  33. receive WM_DRAWITEM messages --- this is not necessary!  In fact,
  34. when repositioning using the WM_VSCROLL message, Windows does what I
  35. want (no owner draw requests except for the newly added item at the
  36. bottom), but then repaints the entire listbox (sending many draw item
  37. requests).
  38.  
  39. For most people, this activity is so fast it is invisible (you can only
  40. catch Windows in the act by overloading your system (say, by running Spy),
  41. or by tracing messages.  I like to really optimize my code, however.
  42.  
  43.