00031 {
00032 POINT ptOrg;
00033
PWND pwndBrush;
00034
PWND pwndPaint;
00035 HWND hwndDesktop;
00036
00037 hwndDesktop =
GetDesktopWindow();
00038
if (hwndBrush ==
NULL) {
00039 hwndBrush = hwndDesktop;
00040 }
00041
00042
if (hwndBrush != hwndPaint) {
00043 pwndBrush =
ValidateHwnd(hwndBrush);
00044
if (pwndBrush ==
NULL) {
00045 RIPMSG1(RIP_WARNING,
"PaintRect: invalid Brush window %lX", hwndBrush);
00046
return FALSE;
00047 }
00048
00049 pwndPaint =
ValidateHwnd(hwndPaint);
00050
if (pwndPaint ==
NULL) {
00051 RIPMSG1(RIP_WARNING,
"PaintRect: invalid Paint window %lX", hwndBrush);
00052
return FALSE;
00053 }
00054
00055
00056
if (hwndBrush != hwndDesktop) {
00057 SetBrushOrgEx(
00058 hdc,
00059 pwndBrush->
rcClient.left - pwndPaint->
rcClient.left,
00060 pwndBrush->
rcClient.top - pwndPaint->
rcClient.top,
00061 &ptOrg);
00062 }
else {
00063 SetBrushOrgEx(hdc, 0, 0, &ptOrg);
00064 }
00065 }
00066
00067
00068
00069
00070
00071
00072
00073
if (hbr < (HBRUSH)CTLCOLOR_MAX) {
00074 hbr =
GetControlColor(hwndBrush, hwndPaint, hdc,
00075 HandleToUlong(hbr) + WM_CTLCOLORMSGBOX);
00076 }
00077
00078
FillRect(hdc, lprc, hbr);
00079
00080
if (hwndBrush != hwndPaint) {
00081 SetBrushOrgEx(hdc, ptOrg.x, ptOrg.y, NULL);
00082 }
00083
00084
return TRUE;
00085 }