2 * Window painting functions
4 * Copyright 1993, 1994, 1995 Alexandre Julliard
6 * FIXME: Do not repaint full nonclient area all the time. Instead, compute
7 * intersection with hrgnUpdate (which should be moved from client to
8 * window coords as well, lookup 'the pain' comment in the winpos.c).
16 #include "wine/winuser16.h"
18 /* Last CTLCOLOR id */
19 #define CTLCOLOR_MAX CTLCOLOR_STATIC
21 /***********************************************************************
25 void WIN_UpdateNCArea(WND* wnd, BOOL bUpdate)
30 TRACE(nonclient,"hwnd %04x, hrgnUpdate %04x\n",
31 wnd->hwndSelf, wnd->hrgnUpdate );
33 /* desktop window doesn't have nonclient area */
34 if(wnd == WIN_GetDesktop())
36 wnd->flags &= ~WIN_NEEDS_NCPAINT;
42 if( wnd->hrgnUpdate > 1 )
44 ClientToScreen16(wnd->hwndSelf, &pt);
46 hClip = CreateRectRgn( 0, 0, 0, 0 );
47 if (!CombineRgn( hClip, wnd->hrgnUpdate, 0, RGN_COPY ))
53 OffsetRgn( hClip, pt.x, pt.y );
57 /* exclude non-client area from update region */
58 HRGN hrgn = CreateRectRgn( 0, 0,
59 wnd->rectClient.right - wnd->rectClient.left,
60 wnd->rectClient.bottom - wnd->rectClient.top);
62 if (hrgn && (CombineRgn( wnd->hrgnUpdate, wnd->hrgnUpdate,
63 hrgn, RGN_AND) == NULLREGION))
65 DeleteObject( wnd->hrgnUpdate );
73 wnd->flags &= ~WIN_NEEDS_NCPAINT;
75 if ((wnd->hwndSelf == GetActiveWindow()) &&
76 !(wnd->flags & WIN_NCACTIVATED))
78 wnd->flags |= WIN_NCACTIVATED;
79 if( hClip > 1) DeleteObject( hClip );
83 if (hClip) SendMessage16( wnd->hwndSelf, WM_NCPAINT, hClip, 0L );
85 if (hClip > 1) DeleteObject( hClip );
89 /***********************************************************************
90 * BeginPaint16 (USER.39)
92 HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
96 WND *wndPtr = WIN_FindWndPtr( hwnd );
97 if (!wndPtr) return 0;
99 bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon);
101 wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
103 if (wndPtr->flags & WIN_NEEDS_NCPAINT) WIN_UpdateNCArea( wndPtr, TRUE );
105 if (((hrgnUpdate = wndPtr->hrgnUpdate) != 0) ||
106 (wndPtr->flags & WIN_INTERNAL_PAINT))
107 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
109 wndPtr->hrgnUpdate = 0;
110 wndPtr->flags &= ~WIN_INTERNAL_PAINT;
114 TRACE(win,"hrgnUpdate = %04x, \n", hrgnUpdate);
116 /* When bIcon is TRUE hrgnUpdate is automatically in window coordinates
117 * (because rectClient == rectWindow for WS_MINIMIZE windows).
120 if (wndPtr->class->style & CS_PARENTDC)
122 /* Don't clip the output to the update region for CS_PARENTDC window */
124 DeleteObject(hrgnUpdate);
125 lps->hdc = GetDCEx16( hwnd, 0, DCX_WINDOWPAINT | DCX_USESTYLE |
126 (bIcon ? DCX_WINDOW : 0) );
130 lps->hdc = GetDCEx16(hwnd, hrgnUpdate, DCX_INTERSECTRGN |
131 DCX_WINDOWPAINT | DCX_USESTYLE |
132 (bIcon ? DCX_WINDOW : 0) );
135 TRACE(win,"hdc = %04x\n", lps->hdc);
139 WARN(win, "GetDCEx() failed in BeginPaint(), hwnd=%04x\n", hwnd);
140 WIN_ReleaseWndPtr(wndPtr);
144 GetClipBox16( lps->hdc, &lps->rcPaint );
146 TRACE(win,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
147 lps->rcPaint.right, lps->rcPaint.bottom );
149 if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
151 wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
152 lps->fErase = !SendMessage16(hwnd, (bIcon) ? WM_ICONERASEBKGND
154 (WPARAM16)lps->hdc, 0 );
156 else lps->fErase = TRUE;
158 WIN_ReleaseWndPtr(wndPtr);
163 /***********************************************************************
164 * BeginPaint32 (USER32.10)
166 HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
170 BeginPaint16( hwnd, &ps );
171 lps->hdc = (HDC)ps.hdc;
172 lps->fErase = ps.fErase;
173 lps->rcPaint.top = ps.rcPaint.top;
174 lps->rcPaint.left = ps.rcPaint.left;
175 lps->rcPaint.right = ps.rcPaint.right;
176 lps->rcPaint.bottom = ps.rcPaint.bottom;
177 lps->fRestore = ps.fRestore;
178 lps->fIncUpdate = ps.fIncUpdate;
183 /***********************************************************************
184 * EndPaint16 (USER.40)
186 BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps )
188 ReleaseDC16( hwnd, lps->hdc );
194 /***********************************************************************
195 * EndPaint32 (USER32.176)
197 BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
199 ReleaseDC( hwnd, lps->hdc );
205 /***********************************************************************
206 * FillWindow (USER.324)
208 void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hbrush )
211 GetClientRect16( hwnd, &rect );
212 DPtoLP16( hdc, (LPPOINT16)&rect, 2 );
213 PaintRect16( hwndParent, hwnd, hdc, hbrush, &rect );
217 /***********************************************************************
218 * PAINT_GetControlBrush
220 static HBRUSH16 PAINT_GetControlBrush( HWND hParent, HWND hWnd, HDC16 hDC, UINT16 ctlType )
222 HBRUSH16 bkgBrush = (HBRUSH16)SendMessageA( hParent, WM_CTLCOLORMSGBOX + ctlType,
223 (WPARAM)hDC, (LPARAM)hWnd );
224 if( !IsGDIObject16(bkgBrush) )
225 bkgBrush = DEFWND_ControlColor( hDC, ctlType );
230 /***********************************************************************
231 * PaintRect (USER.325)
233 void WINAPI PaintRect16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
234 HBRUSH16 hbrush, const RECT16 *rect)
236 if( hbrush <= CTLCOLOR_MAX )
239 hbrush = PAINT_GetControlBrush( hwndParent, hwnd, hdc, (UINT16)hbrush );
244 FillRect16( hdc, rect, hbrush );
248 /***********************************************************************
249 * GetControlBrush (USER.326)
251 HBRUSH16 WINAPI GetControlBrush16( HWND16 hwnd, HDC16 hdc, UINT16 ctlType )
253 WND* wndPtr = WIN_FindWndPtr( hwnd );
256 if((ctlType <= CTLCOLOR_MAX) && wndPtr )
259 if( wndPtr->dwStyle & WS_POPUP ) parent = WIN_LockWndPtr(wndPtr->owner);
260 else parent = WIN_LockWndPtr(wndPtr->parent);
261 if( !parent ) parent = wndPtr;
262 retvalue = (HBRUSH16)PAINT_GetControlBrush( parent->hwndSelf, hwnd, hdc, ctlType );
263 WIN_ReleaseWndPtr(parent);
266 retvalue = (HBRUSH16)0;
268 WIN_ReleaseWndPtr(wndPtr);
273 /***********************************************************************
276 * FIXME: Windows uses WM_SYNCPAINT to cut down the number of intertask
277 * SendMessage() calls. This is a comment inside DefWindowProc() source
280 * This message avoids lots of inter-app message traffic
281 * by switching to the other task and continuing the
285 * LOWORD(lParam) = hrgnClip
286 * HIWORD(lParam) = hwndSkip (not used; always NULL)
288 * All in all, a prime candidate for a rewrite.
290 BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
291 HRGN hrgnUpdate, UINT flags, UINT control )
299 if (!hwnd) hwnd = GetDesktopWindow();
300 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return FALSE;
301 if (!WIN_IsWindowDrawable( wndPtr, !(flags & RDW_FRAME) ) )
303 WIN_ReleaseWndPtr(wndPtr);
304 return TRUE; /* No redraw needed */
307 bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon);
310 TRACE(win, "%04x %d,%d-%d,%d %04x flags=%04x\n",
311 hwnd, rectUpdate->left, rectUpdate->top,
312 rectUpdate->right, rectUpdate->bottom, hrgnUpdate, flags );
316 TRACE(win, "%04x NULL %04x flags=%04x\n", hwnd, hrgnUpdate, flags);
319 GetClientRect( hwnd, &rectClient );
321 if (flags & RDW_INVALIDATE) /* Invalidate */
323 int rgnNotEmpty = COMPLEXREGION;
325 if (wndPtr->hrgnUpdate > 1) /* Is there already an update region? */
327 if ((hrgn = hrgnUpdate) == 0)
328 hrgn = CreateRectRgnIndirect( rectUpdate ? rectUpdate :
330 rgnNotEmpty = CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate,
332 if (!hrgnUpdate) DeleteObject( hrgn );
334 else /* No update region yet */
336 if (!(wndPtr->flags & WIN_INTERNAL_PAINT))
337 QUEUE_IncPaintCount( wndPtr->hmemTaskQ );
340 wndPtr->hrgnUpdate = CreateRectRgn( 0, 0, 0, 0 );
341 rgnNotEmpty = CombineRgn( wndPtr->hrgnUpdate, hrgnUpdate,
344 else wndPtr->hrgnUpdate = CreateRectRgnIndirect( rectUpdate ?
345 rectUpdate : &rectClient );
348 if (flags & RDW_FRAME) wndPtr->flags |= WIN_NEEDS_NCPAINT;
350 /* restrict update region to client area (FIXME: correct?) */
351 if (wndPtr->hrgnUpdate)
353 HRGN clientRgn = CreateRectRgnIndirect( &rectClient );
354 rgnNotEmpty = CombineRgn( wndPtr->hrgnUpdate, clientRgn,
355 wndPtr->hrgnUpdate, RGN_AND );
356 DeleteObject( clientRgn );
359 /* check for bogus update region */
360 if ( rgnNotEmpty == NULLREGION )
362 wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
363 DeleteObject( wndPtr->hrgnUpdate );
364 wndPtr->hrgnUpdate=0;
365 if (!(wndPtr->flags & WIN_INTERNAL_PAINT))
366 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
369 if (flags & RDW_ERASE) wndPtr->flags |= WIN_NEEDS_ERASEBKGND;
370 flags |= RDW_FRAME; /* Force children frame invalidation */
372 else if (flags & RDW_VALIDATE) /* Validate */
374 /* We need an update region in order to validate anything */
375 if (wndPtr->hrgnUpdate > 1)
377 if (!hrgnUpdate && !rectUpdate)
379 /* Special case: validate everything */
380 DeleteObject( wndPtr->hrgnUpdate );
381 wndPtr->hrgnUpdate = 0;
385 if ((hrgn = hrgnUpdate) == 0)
386 hrgn = CreateRectRgnIndirect( rectUpdate );
387 if (CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate,
388 hrgn, RGN_DIFF ) == NULLREGION)
390 DeleteObject( wndPtr->hrgnUpdate );
391 wndPtr->hrgnUpdate = 0;
393 if (!hrgnUpdate) DeleteObject( hrgn );
395 if (!wndPtr->hrgnUpdate) /* No more update region */
396 if (!(wndPtr->flags & WIN_INTERNAL_PAINT))
397 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
399 if (flags & RDW_NOFRAME) wndPtr->flags &= ~WIN_NEEDS_NCPAINT;
400 if (flags & RDW_NOERASE) wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
403 /* Set/clear internal paint flag */
405 if (flags & RDW_INTERNALPAINT)
407 if ( wndPtr->hrgnUpdate <= 1 && !(wndPtr->flags & WIN_INTERNAL_PAINT))
408 QUEUE_IncPaintCount( wndPtr->hmemTaskQ );
409 wndPtr->flags |= WIN_INTERNAL_PAINT;
411 else if (flags & RDW_NOINTERNALPAINT)
413 if ( wndPtr->hrgnUpdate <= 1 && (wndPtr->flags & WIN_INTERNAL_PAINT))
414 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
415 wndPtr->flags &= ~WIN_INTERNAL_PAINT;
418 /* Erase/update window */
420 if (flags & RDW_UPDATENOW)
422 if (wndPtr->hrgnUpdate) /* wm_painticon wparam is 1 */
423 SendMessage16( hwnd, (bIcon) ? WM_PAINTICON : WM_PAINT, bIcon, 0 );
425 else if (flags & RDW_ERASENOW)
427 if (wndPtr->flags & WIN_NEEDS_NCPAINT)
428 WIN_UpdateNCArea( wndPtr, FALSE);
430 if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
432 HDC hdc = GetDCEx( hwnd, wndPtr->hrgnUpdate,
433 DCX_INTERSECTRGN | DCX_USESTYLE |
434 DCX_KEEPCLIPRGN | DCX_WINDOWPAINT |
435 (bIcon ? DCX_WINDOW : 0) );
438 if (SendMessage16( hwnd, (bIcon) ? WM_ICONERASEBKGND
441 wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
442 ReleaseDC( hwnd, hdc );
447 if ( !IsWindow( hwnd ) )
449 WIN_ReleaseWndPtr(wndPtr);
453 /* Recursively process children */
455 if (!(flags & RDW_NOCHILDREN) &&
456 ((flags & RDW_ALLCHILDREN) || !(wndPtr->dwStyle & WS_CLIPCHILDREN)) &&
457 !(wndPtr->dwStyle & WS_MINIMIZE) )
459 if ( hrgnUpdate || rectUpdate )
461 if (!(hrgn = CreateRectRgn( 0, 0, 0, 0 )))
463 WIN_ReleaseWndPtr(wndPtr);
468 control |= (RDW_C_DELETEHRGN | RDW_C_USEHRGN);
469 if( !(hrgnUpdate = CreateRectRgnIndirect( rectUpdate )) )
471 DeleteObject( hrgn );
472 WIN_ReleaseWndPtr(wndPtr);
476 if( (list = WIN_BuildWinArray( wndPtr, 0, NULL )) )
478 for (ppWnd = list; *ppWnd; ppWnd++)
480 WIN_UpdateWndPtr(&wndPtr,*ppWnd);
481 if (!IsWindow(wndPtr->hwndSelf)) continue;
482 if (wndPtr->dwStyle & WS_VISIBLE)
485 wndPtr->rectWindow.left, wndPtr->rectWindow.top,
486 wndPtr->rectWindow.right, wndPtr->rectWindow.bottom );
487 if (CombineRgn( hrgn, hrgn, hrgnUpdate, RGN_AND ))
489 OffsetRgn( hrgn, -wndPtr->rectClient.left,
490 -wndPtr->rectClient.top );
491 PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, hrgn, flags,
496 WIN_ReleaseWinArray(list);
498 DeleteObject( hrgn );
499 if (control & RDW_C_DELETEHRGN) DeleteObject( hrgnUpdate );
503 if( (list = WIN_BuildWinArray( wndPtr, 0, NULL )) )
505 for (ppWnd = list; *ppWnd; ppWnd++)
507 WIN_UpdateWndPtr(&wndPtr,*ppWnd);
508 if (IsWindow( wndPtr->hwndSelf ))
509 PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, 0, flags, 0 );
511 WIN_ReleaseWinArray(list);
516 WIN_ReleaseWndPtr(wndPtr);
521 /***********************************************************************
522 * RedrawWindow32 (USER32.426)
524 BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rectUpdate,
525 HRGN hrgnUpdate, UINT flags )
527 return PAINT_RedrawWindow( hwnd, rectUpdate, hrgnUpdate, flags, 0 );
531 /***********************************************************************
532 * RedrawWindow16 (USER.290)
534 BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate,
535 HRGN16 hrgnUpdate, UINT16 flags )
540 CONV_RECT16TO32( rectUpdate, &r );
541 return (BOOL16)RedrawWindow( (HWND)hwnd, &r, hrgnUpdate, flags );
543 return (BOOL16)PAINT_RedrawWindow( (HWND)hwnd, NULL,
544 (HRGN)hrgnUpdate, flags, 0 );
548 /***********************************************************************
549 * UpdateWindow16 (USER.124)
551 void WINAPI UpdateWindow16( HWND16 hwnd )
553 PAINT_RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_NOCHILDREN, 0 );
556 /***********************************************************************
557 * UpdateWindow32 (USER32.567)
559 void WINAPI UpdateWindow( HWND hwnd )
561 PAINT_RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_NOCHILDREN, 0 );
564 /***********************************************************************
565 * InvalidateRgn16 (USER.126)
567 void WINAPI InvalidateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
569 PAINT_RedrawWindow((HWND)hwnd, NULL, (HRGN)hrgn,
570 RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
574 /***********************************************************************
575 * InvalidateRgn32 (USER32.329)
577 BOOL WINAPI InvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
579 return PAINT_RedrawWindow(hwnd, NULL, hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
583 /***********************************************************************
584 * InvalidateRect16 (USER.125)
586 void WINAPI InvalidateRect16( HWND16 hwnd, const RECT16 *rect, BOOL16 erase )
588 RedrawWindow16( hwnd, rect, 0, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
592 /***********************************************************************
593 * InvalidateRect32 (USER32.328)
595 BOOL WINAPI InvalidateRect( HWND hwnd, const RECT *rect, BOOL erase )
597 return PAINT_RedrawWindow( hwnd, rect, 0,
598 RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
602 /***********************************************************************
603 * ValidateRgn16 (USER.128)
605 void WINAPI ValidateRgn16( HWND16 hwnd, HRGN16 hrgn )
607 PAINT_RedrawWindow( (HWND)hwnd, NULL, (HRGN)hrgn,
608 RDW_VALIDATE | RDW_NOCHILDREN, 0 );
612 /***********************************************************************
613 * ValidateRgn32 (USER32.572)
615 void WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
617 PAINT_RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOCHILDREN, 0 );
621 /***********************************************************************
622 * ValidateRect16 (USER.127)
624 void WINAPI ValidateRect16( HWND16 hwnd, const RECT16 *rect )
626 RedrawWindow16( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN );
630 /***********************************************************************
631 * ValidateRect32 (USER32.571)
633 void WINAPI ValidateRect( HWND hwnd, const RECT *rect )
635 PAINT_RedrawWindow( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN, 0 );
639 /***********************************************************************
640 * GetUpdateRect16 (USER.190)
642 BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
647 if (!rect) return GetUpdateRect( hwnd, NULL, erase );
648 ret = GetUpdateRect( hwnd, &r, erase );
649 CONV_RECT32TO16( &r, rect );
654 /***********************************************************************
655 * GetUpdateRect32 (USER32.297)
657 BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
660 WND * wndPtr = WIN_FindWndPtr( hwnd );
661 if (!wndPtr) return FALSE;
665 if (wndPtr->hrgnUpdate > 1)
667 HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
668 if (GetUpdateRgn( hwnd, hrgn, erase ) == ERROR)
673 GetRgnBox( hrgn, rect );
674 DeleteObject( hrgn );
675 if (wndPtr->class->style & CS_OWNDC)
677 if (GetMapMode(wndPtr->dce->hDC) != MM_TEXT)
679 DPtoLP (wndPtr->dce->hDC, (LPPOINT)rect, 2);
683 else SetRectEmpty( rect );
685 retvalue = (wndPtr->hrgnUpdate > 1);
687 WIN_ReleaseWndPtr(wndPtr);
692 /***********************************************************************
693 * GetUpdateRgn16 (USER.237)
695 INT16 WINAPI GetUpdateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
697 return GetUpdateRgn( hwnd, hrgn, erase );
701 /***********************************************************************
702 * GetUpdateRgn32 (USER32.298)
704 INT WINAPI GetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
707 WND * wndPtr = WIN_FindWndPtr( hwnd );
708 if (!wndPtr) return ERROR;
710 if (wndPtr->hrgnUpdate <= 1)
712 SetRectRgn( hrgn, 0, 0, 0, 0 );
716 retval = CombineRgn( hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY );
717 if (erase) RedrawWindow( hwnd, NULL, 0, RDW_ERASENOW | RDW_NOCHILDREN );
719 WIN_ReleaseWndPtr(wndPtr);
724 /***********************************************************************
725 * ExcludeUpdateRgn16 (USER.238)
727 INT16 WINAPI ExcludeUpdateRgn16( HDC16 hdc, HWND16 hwnd )
729 return ExcludeUpdateRgn( hdc, hwnd );
733 /***********************************************************************
734 * ExcludeUpdateRgn32 (USER32.195)
736 INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
741 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return ERROR;
743 if (wndPtr->hrgnUpdate)
746 HRGN hrgn = CreateRectRgn(wndPtr->rectWindow.left - wndPtr->rectClient.left,
747 wndPtr->rectWindow.top - wndPtr->rectClient.top,
748 wndPtr->rectClient.right - wndPtr->rectClient.left,
749 wndPtr->rectClient.bottom - wndPtr->rectClient.top);
750 if( wndPtr->hrgnUpdate > 1 )
751 CombineRgn(hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY);
753 /* do ugly coordinate translations in dce.c */
755 ret = DCE_ExcludeRgn( hdc, wndPtr, hrgn );
756 DeleteObject( hrgn );
757 WIN_ReleaseWndPtr(wndPtr);
760 WIN_ReleaseWndPtr(wndPtr);
761 return GetClipBox( hdc, &rect );