在网上看到了这篇文章:并经过实验得知:
from:http://blog.csdn.net/lyclowlevel/article/details/5481393
影响背景刷新的因素有:1、注册窗口类时,是否指定了hbrBackground;2、调用InvalidateRect时,第三个参数的取值。可以分为以下三种情况:
1、未指定hbrBackground
BeginPaint返回的PAINTSTRUCT的成员fErase为TRUE
//这个无论设置与否 都返回true 请高人指点
2、指定了hbrBackground且调用InvalidateRect时第三个参数为FALSE
BeginPaint返回的PAINTSTRUCT的成员fErase为TRUE
3、指定了hbrBackground且调用InvalidateRect时第三个参数为TRUE(或未调用InvalidateRect)
BeginPaint返回的PAINTSTRUCT的成员fErase为FALSE
后面两条都验证了:
其中3: beginPaint 然后响应wm_erasebkgnd 然后endpaint