WM_ERASEBKGND的返回值
WM_ERASEBKGND的返回值:
Return value
Type: LRESULT
An application should return nonzero if it erases the background; otherwise, it should return zero.
根据msdn的资料,无论改成return 1或者return 0,只要移动窗口,就导致画图的的乱七八糟的。
貌似返回值不管用啊.
问题2:wm_erasebkgnd什么什么情况下使用??
case WM_ERASEBKGND:
{
int j=2;
j++;
return 1; //return 0
}
break;
case WM_PAINT:
{
hdc = BeginPaint (hwnd, &ps) ;
SelectObject(hdc,GetStockObject(GRAY_BRUSH));
for (i = 0 ; i < 10 ; i++)
{
apt[i].x = cxClient * aptFigure[i].x / 200 ;
apt[i].y = cyClient * aptFigure[i].y / 100 ;
}
SetPolyFillMode(hdc,ALTERNATE);
Polygon(hdc,apt,sizeof(apt)/sizeof(POINT));
EndPaint (hwnd, &ps) ;
return 0 ;
}
break;