[comp.windows.ms] Programming problem...

green@ai.toronto.edu (Anthony Thomas Green) (02/27/90)

Ack! I have a perplexing question...

I am writing an application with the SDK. The problem I am having is that
whenever I process a WM_PAINT message, it seems that the entire window has 
been invalidated and that it must repaint the whole thing. This is not
supposed to happen. 
At one point I invalidate a small section of the window, but very carefully.
I know that if I try to InvalidateRect with my lpRect == NULL, it will
invalidate the whole thing, but I am careful, and am only invalidating
a small section. Somebody at Microsoft tech support suggested that it might
have something to do with the way I created my window. Anybody happen apon
a similar weirdity? Any suggestions?

Thanks,

 Anthony Green
 green@ai.toronto.edu

bturner@hpcvlx.cv.hp.com (Bill Turner) (02/28/90)

> I am writing an application with the SDK. The problem I am having is that
> whenever I process a WM_PAINT message, it seems that the entire window has 
> been invalidated and that it must repaint the whole thing. This is not
> supposed to happen. 

You can check to see what Windows thinks is invalid by checking the rcPaint
field in the paint structure returned from BeginPaint.  If you are calling
InvalidateRect with non-NULL (and partial window) rectangles, then it should
do clipping correctly, and only repaint in part of the window.

--Bill Turner (bturner@hp-pcd.hp.com)
HP Interface Technology Operation