Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

draw.c File Reference

#include "precomp.h"

Go to the source code of this file.

Functions

BOOL PaintRect (HWND hwndBrush, HWND hwndPaint, HDC hdc, HBRUSH hbr, LPRECT lprc)


Function Documentation

BOOL PaintRect (  HWND  hwndBrush,
HWND  hwndPaint,
HDC  hdc,
HBRUSH  hbr,
LPRECT  lprc
) 
 

Definition at line 25 of file client/draw.c.

References BOOL, FALSE, FillRect(), GetControlColor, GetDesktopWindow(), NULL, tagWND::rcClient, TRUE, and ValidateHwnd.

Referenced by ButtonWndProcWorker(), ConsoleWindowProc(), xxxBNPaint(), xxxButtonDrawCheck(), and xxxStaticPaint().

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 * If hbr < CTLCOLOR_MAX, it isn't really a brush but is one of our 00069 * special color values. Translate it to the appropriate WM_CTLCOLOR 00070 * message and send it off to get back a real brush. The translation 00071 * process assumes the CTLCOLOR*** and WM_CTLCOLOR*** values map directly. 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 }


Generated on Sat May 15 19:43:29 2004 for test by doxygen 1.3.7