home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4662 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  2.1 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Forced Update (WM_PAINT) of Window
  5. Message-ID: <729@lax.lax.pe-nelson.com>
  6. Date: 6 Jan 93 22:49:15 GMT
  7. References: <C0Fx4F.6Cs@ccu.umanitoba.ca>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 37
  11.  
  12. In article <C0Fx4F.6Cs@ccu.umanitoba.ca>, umwaletz@ccu.umanitoba.ca (James L. Waletzky) writes:
  13. |> I'm using Borland C++ 3.1 to create my app and here's the problem:
  14. |> 
  15. |> I have this main window which contains about 20 children, with each
  16. |> child being a box containing a particular color. Up pops a dialog
  17. |> asking the user to respond to some questions and once this dialog
  18. |> disappears, I would like to update all of the children with their
  19. |> new colors (ie. force a WM_PAINT message).
  20. |> 
  21. |> I thought all I had to do was Invalidate the parent window and call
  22. |> UpdateWindow, but this doesn't seem to work. I then tried Invalidating
  23. |> all of the children and calling UpdateWindow, but this didn't work
  24. |> either. Any ideas?
  25.  
  26. Well, in general either approach should have worked.  You may have to
  27. give us more detail.  Here are some things to check:
  28.  
  29. 1. If the parent window has WS_CLIPCHILDREN style then invalidating and
  30.    repainting the parent will not affect the children.
  31.  
  32. 2. Are you specifying TRUE or FALSE in the InvalidateRect() call for the
  33.    bErase parameter -- try TRUE which will cause the entire window to be 
  34.    cleared with the background brush.
  35.  
  36. 3. Check your logic for getting new colors from the dialog box into your
  37.    application -- perhaps the repaint is happening but you haven't moved
  38.    the new colors into the appropriate variables and the child windows
  39.    are still using the old colors?
  40.  
  41. Good luck!
  42.  
  43.  
  44. ----------------------------------------------------------------------------
  45. Tom Brown               |  "She turned me into a newt...
  46. PE Nelson Systems       |                                  ... I got better"
  47. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  48. ----------------------------------------------------------------------------
  49.