🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2532

Re: Forced Update (WM_PAINT) of Window

#2532
From: Tom W. Brown
Date: Wed, 06 Jan 1993 22:49
37 lines
2216 bytes
In article <C0Fx4F.6Cs@ccu.umanitoba.ca>, umwaletz@ccu.umanitoba.ca (James L. Waletzky) writes:
|> I'm using Borland C++ 3.1 to create my app and here's the problem:
|> 
|> I have this main window which contains about 20 children, with each
|> child being a box containing a particular color. Up pops a dialog
|> asking the user to respond to some questions and once this dialog
|> disappears, I would like to update all of the children with their
|> new colors (ie. force a WM_PAINT message).
|> 
|> I thought all I had to do was Invalidate the parent window and call
|> UpdateWindow, but this doesn't seem to work. I then tried Invalidating
|> all of the children and calling UpdateWindow, but this didn't work
|> either. Any ideas?

Well, in general either approach should have worked.  You may have to
give us more detail.  Here are some things to check:

1. If the parent window has WS_CLIPCHILDREN style then invalidating and
   repainting the parent will not affect the children.

2. Are you specifying TRUE or FALSE in the InvalidateRect() call for the
   bErase parameter -- try TRUE which will cause the entire window to be 
   cleared with the background brush.

3. Check your logic for getting new colors from the dialog box into your
   application -- perhaps the repaint is happening but you haven't moved
   the new colors into the appropriate variables and the child windows
   are still using the old colors?

Good luck!


----------------------------------------------------------------------------
Tom Brown               |  "She turned me into a newt...
PE Nelson Systems       |                                  ... I got better"
twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
----------------------------------------------------------------------------
Technical Details
Message-ID: <729@lax.lax.pe-nelson.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
References: <C0Fx4F.6Cs@ccu.umanitoba.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown
From: twbrown@PE-Nelson.COM (Tom W. Brown)
Newsgroups: comp.os.ms-windows.programmer.misc
Subject: Re: Forced Update (WM_PAINT) of Window
Message-ID: <729@lax.lax.pe-nelson.com>
Date: 6 Jan 93 22:49:15 GMT
References: <C0Fx4F.6Cs@ccu.umanitoba.ca>
Sender: news@lax.pe-nelson.com
Organization: PE-Nelson
Lines: 37