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).
17 #include "wine/winuser16.h"
19 /* Last CTLCOLOR id */
20 #define CTLCOLOR_MAX CTLCOLOR_STATIC
22 /***********************************************************************
26 void WIN_UpdateNCArea(WND* wnd, BOOL bUpdate)
31 TRACE(nonclient,"hwnd %04x, hrgnUpdate %04x\n",
32 wnd->hwndSelf, wnd->hrgnUpdate );
34 /* desktop window doesn't have nonclient area */
35 if(wnd == WIN_GetDesktop())
37 wnd->flags &= ~WIN_NEEDS_NCPAINT;
43 if( wnd->hrgnUpdate > 1 )
45 ClientToScreen16(wnd->hwndSelf, &pt);
47 hClip = CreateRectRgn( 0, 0, 0, 0 );
48 if (!CombineRgn( hClip, wnd->hrgnUpdate, 0, RGN_COPY ))
54 OffsetRgn( hClip, pt.x, pt.y );
58 /* exclude non-client area from update region */
59 HRGN hrgn = CreateRectRgn( 0, 0,
60 wnd->rectClient.right - wnd->rectClient.left,
61 wnd->rectClient.bottom - wnd->rectClient.top);
63 if (hrgn && (CombineRgn( wnd->hrgnUpdate, wnd->hrgnUpdate,
64 hrgn, RGN_AND) == NULLREGION))
66 DeleteObject( wnd->hrgnUpdate );
74 wnd->flags &= ~WIN_NEEDS_NCPAINT;
76 if ((wnd->hwndSelf == GetActiveWindow()) &&
77 !(wnd->flags & WIN_NCACTIVATED))
79 wnd->flags |= WIN_NCACTIVATED;
80 if( hClip > 1) DeleteObject( hClip );
84 if (hClip) SendMessage16( wnd->hwndSelf, WM_NCPAINT, hClip, 0L );
86 if (hClip > 1) DeleteObject( hClip );
90 /***********************************************************************
91 * BeginPaint16 (USER.39)
93 HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
97 WND *wndPtr = WIN_FindWndPtr( hwnd );
98 if (!wndPtr) return 0;
100 bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon);
102 wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT;
104 if (wndPtr->flags & WIN_NEEDS_NCPAINT) WIN_UpdateNCArea( wndPtr, TRUE );
106 if (((hrgnUpdate = wndPtr->hrgnUpdate) != 0) ||
107 (wndPtr->flags & WIN_INTERNAL_PAINT))
108 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
110 wndPtr->hrgnUpdate = 0;
111 wndPtr->flags &= ~WIN_INTERNAL_PAINT;
115 TRACE(win,"hrgnUpdate = %04x, \n", hrgnUpdate);
117 /* When bIcon is TRUE hrgnUpdate is automatically in window coordinates
118 * (because rectClient == rectWindow for WS_MINIMIZE windows).
121 if (wndPtr->class->style & CS_PARENTDC)
123 /* Don't clip the output to the update region for CS_PARENTDC window */
125 DeleteObject(hrgnUpdate);
126 lps->hdc = GetDCEx16( hwnd, 0, DCX_WINDOWPAINT | DCX_USESTYLE |
127 (bIcon ? DCX_WINDOW : 0) );
131 lps->hdc = GetDCEx16(hwnd, hrgnUpdate, DCX_INTERSECTRGN |
132 DCX_WINDOWPAINT | DCX_USESTYLE |
133 (bIcon ? DCX_WINDOW : 0) );
136 TRACE(win,"hdc = %04x\n", lps->hdc);
140 WARN(win, "GetDCEx() failed in BeginPaint(), hwnd=%04x\n", hwnd);
141 WIN_ReleaseWndPtr(wndPtr);
145 GetClipBox16( lps->hdc, &lps->rcPaint );
147 TRACE(win,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
148 lps->rcPaint.right, lps->rcPaint.bottom );
150 if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
152 wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
153 lps->fErase = !SendMessage16(hwnd, (bIcon) ? WM_ICONERASEBKGND
155 (WPARAM16)lps->hdc, 0 );
157 else lps->fErase = TRUE;
159 WIN_ReleaseWndPtr(wndPtr);
164 /***********************************************************************
165 * BeginPaint32 (USER32.10)
167 HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
171 BeginPaint16( hwnd, &ps );
172 lps->hdc = (HDC)ps.hdc;
173 lps->fErase = ps.fErase;
174 lps->rcPaint.top = ps.rcPaint.top;
175 lps->rcPaint.left = ps.rcPaint.left;
176 lps->rcPaint.right = ps.rcPaint.right;
177 lps->rcPaint.bottom = ps.rcPaint.bottom;
178 lps->fRestore = ps.fRestore;
179 lps->fIncUpdate = ps.fIncUpdate;
184 /***********************************************************************
185 * EndPaint16 (USER.40)
187 BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps )
189 ReleaseDC16( hwnd, lps->hdc );
195 /***********************************************************************
196 * EndPaint32 (USER32.176)
198 BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
200 ReleaseDC( hwnd, lps->hdc );
206 /***********************************************************************
207 * FillWindow (USER.324)
209 void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hbrush )
212 GetClientRect16( hwnd, &rect );
213 DPtoLP16( hdc, (LPPOINT16)&rect, 2 );
214 PaintRect16( hwndParent, hwnd, hdc, hbrush, &rect );
218 /***********************************************************************
219 * PAINT_GetControlBrush
221 static HBRUSH16 PAINT_GetControlBrush( HWND hParent, HWND hWnd, HDC16 hDC, UINT16 ctlType )
223 HBRUSH16 bkgBrush = (HBRUSH16)SendMessageA( hParent, WM_CTLCOLORMSGBOX + ctlType,
224 (WPARAM)hDC, (LPARAM)hWnd );
225 if( !IsGDIObject16(bkgBrush) )
226 bkgBrush = DEFWND_ControlColor( hDC, ctlType );
231 /***********************************************************************
232 * PaintRect (USER.325)
234 void WINAPI PaintRect16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
235 HBRUSH16 hbrush, const RECT16 *rect)
237 if( hbrush <= CTLCOLOR_MAX )
240 hbrush = PAINT_GetControlBrush( hwndParent, hwnd, hdc, (UINT16)hbrush );
245 FillRect16( hdc, rect, hbrush );
249 /***********************************************************************
250 * GetControlBrush (USER.326)
252 HBRUSH16 WINAPI GetControlBrush16( HWND16 hwnd, HDC16 hdc, UINT16 ctlType )
254 WND* wndPtr = WIN_FindWndPtr( hwnd );
257 if((ctlType <= CTLCOLOR_MAX) && wndPtr )
260 if( wndPtr->dwStyle & WS_POPUP ) parent = WIN_LockWndPtr(wndPtr->owner);
261 else parent = WIN_LockWndPtr(wndPtr->parent);
262 if( !parent ) parent = wndPtr;
263 retvalue = (HBRUSH16)PAINT_GetControlBrush( parent->hwndSelf, hwnd, hdc, ctlType );
264 WIN_ReleaseWndPtr(parent);
267 retvalue = (HBRUSH16)0;
269 WIN_ReleaseWndPtr(wndPtr);
274 /***********************************************************************
277 * FIXME: Windows uses WM_SYNCPAINT to cut down the number of intertask
278 * SendMessage() calls. This is a comment inside DefWindowProc() source
281 * This message avoids lots of inter-app message traffic
282 * by switching to the other task and continuing the
286 * LOWORD(lParam) = hrgnClip
287 * HIWORD(lParam) = hwndSkip (not used; always NULL)
289 * All in all, a prime candidate for a rewrite.
291 BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
292 HRGN hrgnUpdate, UINT flags, UINT control )
300 if (!hwnd) hwnd = GetDesktopWindow();
301 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return FALSE;
302 if (!WIN_IsWindowDrawable( wndPtr, !(flags & RDW_FRAME) ) )
304 WIN_ReleaseWndPtr(wndPtr);
305 return TRUE; /* No redraw needed */
308 bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon);
311 TRACE(win, "%04x %d,%d-%d,%d %04x flags=%04x\n",
312 hwnd, rectUpdate->left, rectUpdate->top,
313 rectUpdate->right, rectUpdate->bottom, hrgnUpdate, flags );
317 TRACE(win, "%04x NULL %04x flags=%04x\n", hwnd, hrgnUpdate, flags);
320 GetClientRect( hwnd, &rectClient );
322 if (flags & RDW_INVALIDATE) /* Invalidate */
324 int rgnNotEmpty = COMPLEXREGION;
326 if (wndPtr->hrgnUpdate > 1) /* Is there already an update region? */
328 if ((hrgn = hrgnUpdate) == 0)
329 hrgn = CreateRectRgnIndirect( rectUpdate ? rectUpdate :
331 rgnNotEmpty = CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate,
333 if (!hrgnUpdate) DeleteObject( hrgn );
335 else /* No update region yet */
337 if (!(wndPtr->flags & WIN_INTERNAL_PAINT))
338 QUEUE_IncPaintCount( wndPtr->hmemTaskQ );
341 wndPtr->hrgnUpdate = CreateRectRgn( 0, 0, 0, 0 );
342 rgnNotEmpty = CombineRgn( wndPtr->hrgnUpdate, hrgnUpdate,
345 else wndPtr->hrgnUpdate = CreateRectRgnIndirect( rectUpdate ?
346 rectUpdate : &rectClient );
349 if (flags & RDW_FRAME) wndPtr->flags |= WIN_NEEDS_NCPAINT;
351 /* restrict update region to client area (FIXME: correct?) */
352 if (wndPtr->hrgnUpdate)
354 HRGN clientRgn = CreateRectRgnIndirect( &rectClient );
355 rgnNotEmpty = CombineRgn( wndPtr->hrgnUpdate, clientRgn,
356 wndPtr->hrgnUpdate, RGN_AND );
357 DeleteObject( clientRgn );
360 /* check for bogus update region */
361 if ( rgnNotEmpty == NULLREGION )
363 wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
364 DeleteObject( wndPtr->hrgnUpdate );
365 wndPtr->hrgnUpdate=0;
366 if (!(wndPtr->flags & WIN_INTERNAL_PAINT))
367 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
370 if (flags & RDW_ERASE) wndPtr->flags |= WIN_NEEDS_ERASEBKGND;
371 flags |= RDW_FRAME; /* Force children frame invalidation */
373 else if (flags & RDW_VALIDATE) /* Validate */
375 /* We need an update region in order to validate anything */
376 if (wndPtr->hrgnUpdate > 1)
378 if (!hrgnUpdate && !rectUpdate)
380 /* Special case: validate everything */
381 DeleteObject( wndPtr->hrgnUpdate );
382 wndPtr->hrgnUpdate = 0;
386 if ((hrgn = hrgnUpdate) == 0)
387 hrgn = CreateRectRgnIndirect( rectUpdate );
388 if (CombineRgn( wndPtr->hrgnUpdate, wndPtr->hrgnUpdate,
389 hrgn, RGN_DIFF ) == NULLREGION)
391 DeleteObject( wndPtr->hrgnUpdate );
392 wndPtr->hrgnUpdate = 0;
394 if (!hrgnUpdate) DeleteObject( hrgn );
396 if (!wndPtr->hrgnUpdate) /* No more update region */
397 if (!(wndPtr->flags & WIN_INTERNAL_PAINT))
398 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
400 if (flags & RDW_NOFRAME) wndPtr->flags &= ~WIN_NEEDS_NCPAINT;
401 if (flags & RDW_NOERASE) wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
404 /* Set/clear internal paint flag */
406 if (flags & RDW_INTERNALPAINT)
408 if ( wndPtr->hrgnUpdate <= 1 && !(wndPtr->flags & WIN_INTERNAL_PAINT))
409 QUEUE_IncPaintCount( wndPtr->hmemTaskQ );
410 wndPtr->flags |= WIN_INTERNAL_PAINT;
412 else if (flags & RDW_NOINTERNALPAINT)
414 if ( wndPtr->hrgnUpdate <= 1 && (wndPtr->flags & WIN_INTERNAL_PAINT))
415 QUEUE_DecPaintCount( wndPtr->hmemTaskQ );
416 wndPtr->flags &= ~WIN_INTERNAL_PAINT;
419 /* Erase/update window */
421 if (flags & RDW_UPDATENOW)
423 if (wndPtr->hrgnUpdate) /* wm_painticon wparam is 1 */
424 SendMessage16( hwnd, (bIcon) ? WM_PAINTICON : WM_PAINT, bIcon, 0 );
426 else if (flags & RDW_ERASENOW)
428 if (wndPtr->flags & WIN_NEEDS_NCPAINT)
429 WIN_UpdateNCArea( wndPtr, FALSE);
431 if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
433 HDC hdc = GetDCEx( hwnd, wndPtr->hrgnUpdate,
434 DCX_INTERSECTRGN | DCX_USESTYLE |
435 DCX_KEEPCLIPRGN | DCX_WINDOWPAINT |
436 (bIcon ? DCX_WINDOW : 0) );
439 if (SendMessage16( hwnd, (bIcon) ? WM_ICONERASEBKGND
442 wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
443 ReleaseDC( hwnd, hdc );
448 /* Recursively process children */
450 if (!(flags & RDW_NOCHILDREN) &&
451 ((flags & RDW_ALLCHILDREN) || !(wndPtr->dwStyle & WS_CLIPCHILDREN)) &&
452 !(wndPtr->dwStyle & WS_MINIMIZE) )
454 if ( hrgnUpdate || rectUpdate )
456 if (!(hrgn = CreateRectRgn( 0, 0, 0, 0 )))
458 WIN_ReleaseWndPtr(wndPtr);
463 control |= (RDW_C_DELETEHRGN | RDW_C_USEHRGN);
464 if( !(hrgnUpdate = CreateRectRgnIndirect( rectUpdate )) )
466 DeleteObject( hrgn );
467 WIN_ReleaseWndPtr(wndPtr);
471 if( (list = WIN_BuildWinArray( wndPtr, 0, NULL )) )
473 for (ppWnd = list; *ppWnd; ppWnd++)
475 WIN_UpdateWndPtr(&wndPtr,*ppWnd);
476 if (!IsWindow(wndPtr->hwndSelf)) continue;
477 if (wndPtr->dwStyle & WS_VISIBLE)
480 wndPtr->rectWindow.left, wndPtr->rectWindow.top,
481 wndPtr->rectWindow.right, wndPtr->rectWindow.bottom );
482 if (CombineRgn( hrgn, hrgn, hrgnUpdate, RGN_AND ))
484 OffsetRgn( hrgn, -wndPtr->rectClient.left,
485 -wndPtr->rectClient.top );
486 PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, hrgn, flags,
491 WIN_ReleaseWinArray(list);
493 DeleteObject( hrgn );
494 if (control & RDW_C_DELETEHRGN) DeleteObject( hrgnUpdate );
498 if( (list = WIN_BuildWinArray( wndPtr, 0, NULL )) )
500 for (ppWnd = list; *ppWnd; ppWnd++)
502 WIN_UpdateWndPtr(&wndPtr,*ppWnd);
503 if (IsWindow( wndPtr->hwndSelf ))
504 PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, 0, flags, 0 );
506 WIN_ReleaseWinArray(list);
511 WIN_ReleaseWndPtr(wndPtr);
516 /***********************************************************************
517 * RedrawWindow32 (USER32.426)
519 BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rectUpdate,
520 HRGN hrgnUpdate, UINT flags )
522 return PAINT_RedrawWindow( hwnd, rectUpdate, hrgnUpdate, flags, 0 );
526 /***********************************************************************
527 * RedrawWindow16 (USER.290)
529 BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate,
530 HRGN16 hrgnUpdate, UINT16 flags )
535 CONV_RECT16TO32( rectUpdate, &r );
536 return (BOOL16)RedrawWindow( (HWND)hwnd, &r, hrgnUpdate, flags );
538 return (BOOL16)PAINT_RedrawWindow( (HWND)hwnd, NULL,
539 (HRGN)hrgnUpdate, flags, 0 );
543 /***********************************************************************
544 * UpdateWindow16 (USER.124)
546 void WINAPI UpdateWindow16( HWND16 hwnd )
548 PAINT_RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_NOCHILDREN, 0 );
551 /***********************************************************************
552 * UpdateWindow32 (USER32.567)
554 void WINAPI UpdateWindow( HWND hwnd )
556 PAINT_RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_NOCHILDREN, 0 );
559 /***********************************************************************
560 * InvalidateRgn16 (USER.126)
562 void WINAPI InvalidateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
564 PAINT_RedrawWindow((HWND)hwnd, NULL, (HRGN)hrgn,
565 RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
569 /***********************************************************************
570 * InvalidateRgn32 (USER32.329)
572 BOOL WINAPI InvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
574 return PAINT_RedrawWindow(hwnd, NULL, hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
578 /***********************************************************************
579 * InvalidateRect16 (USER.125)
581 void WINAPI InvalidateRect16( HWND16 hwnd, const RECT16 *rect, BOOL16 erase )
583 RedrawWindow16( hwnd, rect, 0, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
587 /***********************************************************************
588 * InvalidateRect32 (USER32.328)
590 BOOL WINAPI InvalidateRect( HWND hwnd, const RECT *rect, BOOL erase )
592 return PAINT_RedrawWindow( hwnd, rect, 0,
593 RDW_INVALIDATE | (erase ? RDW_ERASE : 0), 0 );
597 /***********************************************************************
598 * ValidateRgn16 (USER.128)
600 void WINAPI ValidateRgn16( HWND16 hwnd, HRGN16 hrgn )
602 PAINT_RedrawWindow( (HWND)hwnd, NULL, (HRGN)hrgn,
603 RDW_VALIDATE | RDW_NOCHILDREN, 0 );
607 /***********************************************************************
608 * ValidateRgn32 (USER32.572)
610 void WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
612 PAINT_RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE | RDW_NOCHILDREN, 0 );
616 /***********************************************************************
617 * ValidateRect16 (USER.127)
619 void WINAPI ValidateRect16( HWND16 hwnd, const RECT16 *rect )
621 RedrawWindow16( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN );
625 /***********************************************************************
626 * ValidateRect32 (USER32.571)
628 void WINAPI ValidateRect( HWND hwnd, const RECT *rect )
630 PAINT_RedrawWindow( hwnd, rect, 0, RDW_VALIDATE | RDW_NOCHILDREN, 0 );
634 /***********************************************************************
635 * GetUpdateRect16 (USER.190)
637 BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
642 if (!rect) return GetUpdateRect( hwnd, NULL, erase );
643 ret = GetUpdateRect( hwnd, &r, erase );
644 CONV_RECT32TO16( &r, rect );
649 /***********************************************************************
650 * GetUpdateRect32 (USER32.297)
652 BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
655 WND * wndPtr = WIN_FindWndPtr( hwnd );
656 if (!wndPtr) return FALSE;
660 if (wndPtr->hrgnUpdate > 1)
662 HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
663 if (GetUpdateRgn( hwnd, hrgn, erase ) == ERROR)
668 GetRgnBox( hrgn, rect );
669 DeleteObject( hrgn );
670 if (wndPtr->class->style & CS_OWNDC)
672 if (GetMapMode(wndPtr->dce->hDC) != MM_TEXT)
674 DPtoLP (wndPtr->dce->hDC, (LPPOINT)rect, 2);
678 else SetRectEmpty( rect );
680 retvalue = (wndPtr->hrgnUpdate > 1);
682 WIN_ReleaseWndPtr(wndPtr);
687 /***********************************************************************
688 * GetUpdateRgn16 (USER.237)
690 INT16 WINAPI GetUpdateRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 erase )
692 return GetUpdateRgn( hwnd, hrgn, erase );
696 /***********************************************************************
697 * GetUpdateRgn32 (USER32.298)
699 INT WINAPI GetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
702 WND * wndPtr = WIN_FindWndPtr( hwnd );
703 if (!wndPtr) return ERROR;
705 if (wndPtr->hrgnUpdate <= 1)
707 SetRectRgn( hrgn, 0, 0, 0, 0 );
711 retval = CombineRgn( hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY );
712 if (erase) RedrawWindow( hwnd, NULL, 0, RDW_ERASENOW | RDW_NOCHILDREN );
714 WIN_ReleaseWndPtr(wndPtr);
719 /***********************************************************************
720 * ExcludeUpdateRgn16 (USER.238)
722 INT16 WINAPI ExcludeUpdateRgn16( HDC16 hdc, HWND16 hwnd )
724 return ExcludeUpdateRgn( hdc, hwnd );
728 /***********************************************************************
729 * ExcludeUpdateRgn32 (USER32.195)
731 INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
736 if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return ERROR;
738 if (wndPtr->hrgnUpdate)
741 HRGN hrgn = CreateRectRgn(wndPtr->rectWindow.left - wndPtr->rectClient.left,
742 wndPtr->rectWindow.top - wndPtr->rectClient.top,
743 wndPtr->rectClient.right - wndPtr->rectClient.left,
744 wndPtr->rectClient.bottom - wndPtr->rectClient.top);
745 if( wndPtr->hrgnUpdate > 1 )
746 CombineRgn(hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY);
748 /* do ugly coordinate translations in dce.c */
750 ret = DCE_ExcludeRgn( hdc, wndPtr, hrgn );
751 DeleteObject( hrgn );
752 WIN_ReleaseWndPtr(wndPtr);
755 WIN_ReleaseWndPtr(wndPtr);
756 return GetClipBox( hdc, &rect );