[comp.windows.ms] Sending WM_PAINT to all windows

kipnis@janus.Berkeley.EDU (Gary Kipnis) (11/06/89)

Hi, I am trying to use EnumWindows s.t. I can send a WM_PAINT message to
each window, this doesn't seem to work, since none of the windows
get repainted.

any suggestions, sample code?

thank you,

gary

bturner@hpcvlx.cv.hp.com (Bill Turner) (11/07/89)

> Hi, I am trying to use EnumWindows s.t. I can send a WM_PAINT message to
> each window, this doesn't seem to work, since none of the windows
> get repainted.

Well, you can't really just send a WM_PAINT message to a window to get it to
repaint itself.  The WM_PAINT is a side-effect of some other things that need
to be done for painting.

What I'd suggest is calling InvalidateRect to force a repaint of the window.
If you specify that the entire window needs to redisplay, then *everything*
gets redisplayed.  [If you have windows that need partial repainting (i.e.
part of the window is already invalid) and you want only that part to 
repaint, then UpdateWindow will force any pending redisplay to be done.]

--Bill Turner (bturner@hp-pcd.hp.com)
HP Corvallis Information Systems