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

draw.c

Go to the documentation of this file.
00001 00002 /****************************** Module Header ******************************\ 00003 * Module Name: draw.c 00004 * 00005 * Copyright (c) 1985 - 1999, Microsoft Corporation 00006 * 00007 * This module contains the DrawFrameControl API 00008 * 00009 * History: 00010 * 12-12-93 FritzS Ported from Chicago 00011 \***************************************************************************/ 00012 00013 #include "precomp.h" 00014 #pragma hdrstop 00015 00016 /***************************************************************************\ 00017 * PaintRect 00018 * 00019 * History: 00020 * 11-15-90 DarrinM Ported from Win 3.0 sources. 00021 * 01-21-91 IanJa Prefix '_' denoting exported function (although not API) 00022 * 12-12-94 JerrySh Copied from server - make sure to keep in sync 00023 \***************************************************************************/ 00024 00025 BOOL PaintRect( 00026 HWND hwndBrush, 00027 HWND hwndPaint, 00028 HDC hdc, 00029 HBRUSH hbr, 00030 LPRECT lprc) 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:39:46 2004 for test by doxygen 1.3.7