16,472
社区成员
发帖
与我相关
我的任务
分享
//hDialog是对话框窗口句柄
hParent = GetParent(hDialog);
//修改父窗口的DC,iColor[ ]是0~255的数组,通过滚动条控制
hdc = GetDC(hParent);
DeleteObject(SelectObject(hdc,
CreateSolidBrush(RGB(iColor[0],iColor[1],iColor[2]))));
ReleaseDC(hParent,hdc);
InvalidateRect(hParent,NULL,TRUE);
UpdateWindow(hParent);
case WM_PAINT:
hdc = BeginPaint(hWnd,&ps); /
GetClientRect(hWnd,&rect);
Rectangle(hdc,rect.left,rect.top,rect.right,rect.bottom);
EndPaint(hWnd,&ps);
return 0;