2 * Window painting functions
4 * Copyright 1993, 1994, 1995, 2001, 2004 Alexandre Julliard
5 * Copyright 1999 Alex Korobka
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wine/port.h"
33 #include "wine/server.h"
35 #include "user_private.h"
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(win);
41 /***********************************************************************
44 static void dump_rdw_flags(UINT flags)
47 if (flags & RDW_INVALIDATE) TRACE(" RDW_INVALIDATE");
48 if (flags & RDW_INTERNALPAINT) TRACE(" RDW_INTERNALPAINT");
49 if (flags & RDW_ERASE) TRACE(" RDW_ERASE");
50 if (flags & RDW_VALIDATE) TRACE(" RDW_VALIDATE");
51 if (flags & RDW_NOINTERNALPAINT) TRACE(" RDW_NOINTERNALPAINT");
52 if (flags & RDW_NOERASE) TRACE(" RDW_NOERASE");
53 if (flags & RDW_NOCHILDREN) TRACE(" RDW_NOCHILDREN");
54 if (flags & RDW_ALLCHILDREN) TRACE(" RDW_ALLCHILDREN");
55 if (flags & RDW_UPDATENOW) TRACE(" RDW_UPDATENOW");
56 if (flags & RDW_ERASENOW) TRACE(" RDW_ERASENOW");
57 if (flags & RDW_FRAME) TRACE(" RDW_FRAME");
58 if (flags & RDW_NOFRAME) TRACE(" RDW_NOFRAME");
65 RDW_NOINTERNALPAINT | \
74 if (flags & ~RDW_FLAGS) TRACE(" %04x", flags & ~RDW_FLAGS);
80 /***********************************************************************
83 * Return update region (in screen coordinates) for a window.
85 static HRGN get_update_region( HWND hwnd, UINT *flags, HWND *child )
94 if (!(data = HeapAlloc( GetProcessHeap(), 0, sizeof(*data) + size - 1 )))
96 SetLastError( ERROR_OUTOFMEMORY );
100 SERVER_START_REQ( get_update_region )
103 req->from_child = child ? *child : 0;
105 wine_server_set_reply( req, data->Buffer, size );
106 if (!(status = wine_server_call( req )))
108 size_t reply_size = wine_server_reply_size( reply );
109 data->rdh.dwSize = sizeof(data->rdh);
110 data->rdh.iType = RDH_RECTANGLES;
111 data->rdh.nCount = reply_size / sizeof(RECT);
112 data->rdh.nRgnSize = reply_size;
113 hrgn = ExtCreateRegion( NULL, size, data );
114 if (child) *child = reply->child;
115 *flags = reply->flags;
117 else size = reply->total_size;
120 HeapFree( GetProcessHeap(), 0, data );
121 } while (status == STATUS_BUFFER_OVERFLOW);
123 if (status) SetLastError( RtlNtStatusToDosError(status) );
128 /***********************************************************************
131 * Get only the update flags, not the update region.
133 static BOOL get_update_flags( HWND hwnd, HWND *child, UINT *flags )
137 SERVER_START_REQ( get_update_region )
140 req->from_child = child ? *child : 0;
141 req->flags = *flags | UPDATE_NOREGION;
142 if ((ret = !wine_server_call_err( req )))
144 if (child) *child = reply->child;
145 *flags = reply->flags;
153 /***********************************************************************
154 * redraw_window_rects
156 * Redraw part of a window.
158 static BOOL redraw_window_rects( HWND hwnd, UINT flags, const RECT *rects, UINT count )
162 SERVER_START_REQ( redraw_window )
166 wine_server_add_data( req, rects, count * sizeof(RECT) );
167 ret = !wine_server_call_err( req );
174 /***********************************************************************
177 * Send a WM_NCPAINT message if needed, and return the resulting update region (in screen coords).
178 * Helper for erase_now and BeginPaint.
180 static HRGN send_ncpaint( HWND hwnd, HWND *child, UINT *flags )
182 HRGN whole_rgn = get_update_region( hwnd, flags, child );
185 if (child) hwnd = *child;
192 /* check if update rgn overlaps with nonclient area */
193 type = GetRgnBox( whole_rgn, &update );
194 GetClientRect( hwnd, &client );
195 MapWindowPoints( hwnd, 0, (POINT *)&client, 2 );
197 if ((*flags & UPDATE_NONCLIENT) ||
198 update.left < client.left || update.top < client.top ||
199 update.right > client.right || update.bottom > client.bottom)
201 client_rgn = CreateRectRgnIndirect( &client );
202 CombineRgn( client_rgn, client_rgn, whole_rgn, RGN_AND );
204 /* check if update rgn contains complete nonclient area */
205 if (type == SIMPLEREGION)
208 GetWindowRect( hwnd, &window );
209 if (EqualRect( &window, &update ))
211 DeleteObject( whole_rgn );
218 client_rgn = whole_rgn;
222 if (whole_rgn) /* NOTE: WM_NCPAINT allows wParam to be 1 */
224 if (*flags & UPDATE_NONCLIENT) SendMessageW( hwnd, WM_NCPAINT, (WPARAM)whole_rgn, 0 );
225 if (whole_rgn > (HRGN)1) DeleteObject( whole_rgn );
232 /***********************************************************************
235 * Send a WM_ERASEBKGND message if needed, and optionally return the DC for painting.
236 * If a DC is requested, the region is selected into it. In all cases the region is deleted.
237 * Helper for erase_now and BeginPaint.
239 static BOOL send_erase( HWND hwnd, UINT flags, HRGN client_rgn,
240 RECT *clip_rect, HDC *hdc_ret )
242 BOOL need_erase = FALSE;
246 if (!clip_rect) clip_rect = &dummy;
247 if (hdc_ret || (flags & UPDATE_ERASE))
249 UINT dcx_flags = DCX_INTERSECTRGN | DCX_USESTYLE;
250 if (IsIconic(hwnd)) dcx_flags |= DCX_WINDOW;
252 if ((hdc = GetDCEx( hwnd, client_rgn, dcx_flags )))
254 INT type = GetClipBox( hdc, clip_rect );
256 if (flags & UPDATE_ERASE)
258 /* don't erase if the clip box is empty */
259 if (type != NULLREGION)
260 need_erase = !SendMessageW( hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0 );
264 if (need_erase && hwnd != GetDesktopWindow()) /* FIXME: mark it as needing erase again */
265 RedrawWindow( hwnd, clip_rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_NOCHILDREN );
266 ReleaseDC( hwnd, hdc );
270 if (hdc_ret) *hdc_ret = hdc;
272 if (!hdc) DeleteObject( client_rgn );
277 /***********************************************************************
280 * Implementation of RDW_ERASENOW behavior.
282 static void erase_now( HWND hwnd, UINT rdw_flags )
287 /* loop while we find a child to repaint */
290 UINT flags = UPDATE_NONCLIENT | UPDATE_ERASE;
292 if (rdw_flags & RDW_NOCHILDREN) flags |= UPDATE_NOCHILDREN;
293 else if (rdw_flags & RDW_ALLCHILDREN) flags |= UPDATE_ALLCHILDREN;
295 if (!(hrgn = send_ncpaint( hwnd, &child, &flags ))) break;
296 send_erase( child, flags, hrgn, NULL, NULL );
298 if (!flags) break; /* nothing more to do */
299 if (rdw_flags & RDW_NOCHILDREN) break;
304 /***********************************************************************
307 * Implementation of RDW_UPDATENOW behavior.
309 * FIXME: Windows uses WM_SYNCPAINT to cut down the number of intertask
310 * SendMessage() calls. This is a comment inside DefWindowProc() source
313 * This message avoids lots of inter-app message traffic
314 * by switching to the other task and continuing the
318 * LOWORD(lParam) = hrgnClip
319 * HIWORD(lParam) = hwndSkip (not used; always NULL)
322 static void update_now( HWND hwnd, UINT rdw_flags )
326 /* desktop window never gets WM_PAINT, only WM_ERASEBKGND */
327 if (hwnd == GetDesktopWindow()) erase_now( hwnd, rdw_flags | RDW_NOCHILDREN );
329 /* loop while we find a child to repaint */
332 UINT flags = UPDATE_PAINT | UPDATE_INTERNALPAINT;
334 if (rdw_flags & RDW_NOCHILDREN) flags |= UPDATE_NOCHILDREN;
335 else if (rdw_flags & RDW_ALLCHILDREN) flags |= UPDATE_ALLCHILDREN;
337 if (!get_update_flags( hwnd, &child, &flags )) break;
338 if (!flags) break; /* nothing more to do */
340 SendMessageW( child, WM_PAINT, 0, 0 );
341 if (rdw_flags & RDW_NOCHILDREN) break;
346 /*************************************************************************
349 * Helper for ScrollWindowEx.
351 static HWND fix_caret(HWND hWnd, LPRECT lprc, UINT flags)
355 if (!GetGUIThreadInfo( GetCurrentThreadId(), &info )) return 0;
356 if (!info.hwndCaret) return 0;
357 if (info.hwndCaret == hWnd ||
358 ((flags & SW_SCROLLCHILDREN) && IsChild(hWnd, info.hwndCaret)))
361 pt.x = info.rcCaret.left;
362 pt.y = info.rcCaret.top;
363 MapWindowPoints( info.hwndCaret, hWnd, (LPPOINT)&info.rcCaret, 2 );
364 if( IntersectRect(lprc, lprc, &info.rcCaret) )
369 return info.hwndCaret;
376 /***********************************************************************
377 * BeginPaint (USER32.@)
379 HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
383 UINT flags = UPDATE_NONCLIENT | UPDATE_ERASE | UPDATE_PAINT | UPDATE_INTERNALPAINT | UPDATE_NOCHILDREN;
387 if (!(full_handle = WIN_IsCurrentThread( hwnd )))
390 FIXME( "window %p belongs to other thread\n", hwnd );
397 if (!(hrgn = send_ncpaint( hwnd, NULL, &flags ))) return 0;
399 lps->fErase = send_erase( hwnd, flags, hrgn, &lps->rcPaint, &lps->hdc );
401 TRACE("hdc = %p box = (%ld,%ld - %ld,%ld), fErase = %d\n",
402 lps->hdc, lps->rcPaint.left, lps->rcPaint.top, lps->rcPaint.right, lps->rcPaint.bottom,
409 /***********************************************************************
410 * EndPaint (USER32.@)
412 BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
414 if (!lps) return FALSE;
415 if (USER_Driver.pReleaseDC) USER_Driver.pReleaseDC( hwnd, lps->hdc, TRUE );
421 /***********************************************************************
424 HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
426 if (!hwnd) hwnd = GetDesktopWindow();
427 else hwnd = WIN_GetFullHandle( hwnd );
429 if (USER_Driver.pGetDCEx) return USER_Driver.pGetDCEx( hwnd, hrgnClip, flags );
434 /***********************************************************************
437 * Get a device context.
440 * Success: Handle to the device context
443 HDC WINAPI GetDC( HWND hwnd )
445 if (!hwnd) return GetDCEx( 0, 0, DCX_CACHE | DCX_WINDOW );
446 return GetDCEx( hwnd, 0, DCX_USESTYLE );
450 /***********************************************************************
451 * GetWindowDC (USER32.@)
453 HDC WINAPI GetWindowDC( HWND hwnd )
455 return GetDCEx( hwnd, 0, DCX_USESTYLE | DCX_WINDOW );
459 /***********************************************************************
460 * ReleaseDC (USER32.@)
462 * Release a device context.
465 * Success: Non-zero. Resources used by hdc are released.
468 INT WINAPI ReleaseDC( HWND hwnd, HDC hdc )
470 if (USER_Driver.pReleaseDC) return USER_Driver.pReleaseDC( hwnd, hdc, FALSE );
475 /**********************************************************************
476 * WindowFromDC (USER32.@)
478 HWND WINAPI WindowFromDC( HDC hDC )
480 if (USER_Driver.pWindowFromDC) return USER_Driver.pWindowFromDC( hDC );
485 /***********************************************************************
486 * LockWindowUpdate (USER32.@)
488 BOOL WINAPI LockWindowUpdate( HWND hwnd )
490 static HWND lockedWnd;
492 /* This function is fully implemented by the following patch:
494 * http://www.winehq.org/hypermail/wine-patches/2004/01/0142.html
496 * but in order to work properly, it needs the ability to invalidate
497 * DCEs in other processes when the lock window is changed, which
498 * isn't possible yet.
502 FIXME("(%p), partial stub!\n",hwnd);
509 /* Unlock lockedWnd */
510 /* FIXME: Do something */
514 /* Attempted to lock a second window */
515 /* Return FALSE and do nothing */
526 /***********************************************************************
527 * RedrawWindow (USER32.@)
529 BOOL WINAPI RedrawWindow( HWND hwnd, const RECT *rect, HRGN hrgn, UINT flags )
533 if (!hwnd) hwnd = GetDesktopWindow();
540 GetRgnBox( hrgn, &r );
541 TRACE( "%p region %p box %s ", hwnd, hrgn, wine_dbgstr_rect(&r) );
544 TRACE( "%p rect %s ", hwnd, wine_dbgstr_rect(rect) );
546 TRACE( "%p whole window ", hwnd );
548 dump_rdw_flags(flags);
551 /* process pending expose events before painting */
552 if (flags & RDW_UPDATENOW) MsgWaitForMultipleObjects( 0, NULL, FALSE, 0, QS_PAINT );
556 ret = redraw_window_rects( hwnd, flags, rect, 1 );
560 ret = redraw_window_rects( hwnd, flags, NULL, 0 );
562 else /* need to build a list of the region rectangles */
565 RGNDATA *data = NULL;
566 static const RECT empty;
568 if (!(size = GetRegionData( hrgn, 0, NULL ))) return FALSE;
569 if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE;
570 GetRegionData( hrgn, size, data );
571 if (!data->rdh.nCount) /* empty region -> use a single all-zero rectangle */
572 ret = redraw_window_rects( hwnd, flags, &empty, 1 );
574 ret = redraw_window_rects( hwnd, flags, (const RECT *)data->Buffer, data->rdh.nCount );
575 HeapFree( GetProcessHeap(), 0, data );
578 if (flags & RDW_UPDATENOW) update_now( hwnd, flags );
579 else if (flags & RDW_ERASENOW) erase_now( hwnd, flags );
585 /***********************************************************************
586 * UpdateWindow (USER32.@)
588 BOOL WINAPI UpdateWindow( HWND hwnd )
590 return RedrawWindow( hwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
594 /***********************************************************************
595 * InvalidateRgn (USER32.@)
597 BOOL WINAPI InvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
599 return RedrawWindow(hwnd, NULL, hrgn, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
603 /***********************************************************************
604 * InvalidateRect (USER32.@)
606 BOOL WINAPI InvalidateRect( HWND hwnd, const RECT *rect, BOOL erase )
608 return RedrawWindow( hwnd, rect, 0, RDW_INVALIDATE | (erase ? RDW_ERASE : 0) );
612 /***********************************************************************
613 * ValidateRgn (USER32.@)
615 BOOL WINAPI ValidateRgn( HWND hwnd, HRGN hrgn )
617 return RedrawWindow( hwnd, NULL, hrgn, RDW_VALIDATE );
621 /***********************************************************************
622 * ValidateRect (USER32.@)
624 BOOL WINAPI ValidateRect( HWND hwnd, const RECT *rect )
626 return RedrawWindow( hwnd, rect, 0, RDW_VALIDATE );
630 /***********************************************************************
631 * GetUpdateRgn (USER32.@)
633 INT WINAPI GetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
636 UINT flags = UPDATE_NOCHILDREN;
639 if (erase) flags |= UPDATE_NONCLIENT | UPDATE_ERASE;
641 if ((update_rgn = send_ncpaint( hwnd, NULL, &flags )))
645 retval = CombineRgn( hrgn, update_rgn, 0, RGN_COPY );
646 send_erase( hwnd, flags, update_rgn, NULL, NULL );
647 /* map region to client coordinates */
648 offset.x = offset.y = 0;
649 ScreenToClient( hwnd, &offset );
650 OffsetRgn( hrgn, offset.x, offset.y );
656 /***********************************************************************
657 * GetUpdateRect (USER32.@)
659 BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
661 UINT flags = UPDATE_NOCHILDREN;
664 if (erase) flags |= UPDATE_NONCLIENT | UPDATE_ERASE;
666 if (!(update_rgn = send_ncpaint( hwnd, NULL, &flags ))) return FALSE;
670 if (GetRgnBox( update_rgn, rect ) != NULLREGION)
672 HDC hdc = GetDCEx( hwnd, 0, DCX_USESTYLE );
673 MapWindowPoints( 0, hwnd, (LPPOINT)rect, 2 );
674 DPtoLP( hdc, (LPPOINT)rect, 2 );
675 ReleaseDC( hwnd, hdc );
678 send_erase( hwnd, flags, update_rgn, NULL, NULL );
680 /* check if we still have an update region */
681 flags = UPDATE_PAINT | UPDATE_NOCHILDREN;
682 return (get_update_flags( hwnd, NULL, &flags ) && (flags & UPDATE_PAINT));
686 /***********************************************************************
687 * ExcludeUpdateRgn (USER32.@)
689 INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
691 HRGN update_rgn = CreateRectRgn( 0, 0, 0, 0 );
692 INT ret = GetUpdateRgn( hwnd, update_rgn, FALSE );
698 GetDCOrgEx( hdc, &pt );
699 MapWindowPoints( 0, hwnd, &pt, 1 );
700 OffsetRgn( update_rgn, -pt.x, -pt.y );
701 ret = ExtSelectClipRgn( hdc, update_rgn, RGN_DIFF );
702 DeleteObject( update_rgn );
708 /*************************************************************************
709 * ScrollWindowEx (USER32.@)
711 * Note: contrary to what the doc says, pixels that are scrolled from the
712 * outside of clipRect to the inside are NOT painted.
715 INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
716 const RECT *rect, const RECT *clipRect,
717 HRGN hrgnUpdate, LPRECT rcUpdate,
720 INT retVal = NULLREGION;
722 BOOL bUpdate = (rcUpdate || hrgnUpdate || flags & (SW_INVALIDATE | SW_ERASE));
729 HWND hwndCaret = NULL;
731 TRACE( "%p, %d,%d hrgnUpdate=%p rcUpdate = %p %s %04x\n",
732 hwnd, dx, dy, hrgnUpdate, rcUpdate, wine_dbgstr_rect(rect), flags );
733 TRACE( "clipRect = %s\n", wine_dbgstr_rect(clipRect));
734 if( flags & ~( SW_SCROLLCHILDREN | SW_INVALIDATE | SW_ERASE))
735 FIXME("some flags (%04x) are unhandled\n", flags);
737 rdw_flags = (flags & SW_ERASE) && (flags & SW_INVALIDATE) ?
738 RDW_INVALIDATE | RDW_ERASE : RDW_INVALIDATE ;
740 if (!WIN_IsWindowDrawable( hwnd, TRUE )) return ERROR;
741 hwnd = WIN_GetFullHandle( hwnd );
743 GetClientRect(hwnd, &rc);
744 if (rect) IntersectRect(&rc, &rc, rect);
746 if (clipRect) IntersectRect(&cliprc,&rc,clipRect);
749 if( hrgnUpdate ) bOwnRgn = FALSE;
750 else if( bUpdate ) hrgnUpdate = CreateRectRgn( 0, 0, 0, 0 );
752 if( !IsRectEmpty(&cliprc) && (dx || dy)) {
753 DWORD dcxflags = DCX_CACHE;
754 DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
756 hwndCaret = fix_caret(hwnd, &caretrc, flags);
758 if( style & WS_CLIPSIBLINGS) dcxflags |= DCX_CLIPSIBLINGS;
759 if( GetClassLongW( hwnd, GCL_STYLE ) & CS_PARENTDC)
760 dcxflags |= DCX_PARENTCLIP;
761 if( !(flags & SW_SCROLLCHILDREN) && (style & WS_CLIPCHILDREN))
762 dcxflags |= DCX_CLIPCHILDREN;
763 hDC = GetDCEx( hwnd, 0, dcxflags);
766 ScrollDC( hDC, dx, dy, &rc, &cliprc, hrgnUpdate, rcUpdate );
768 ReleaseDC( hwnd, hDC );
771 RedrawWindow( hwnd, NULL, hrgnUpdate, rdw_flags);
774 /* If the windows has an update region, this must be
775 * scrolled as well. Keep a copy in hrgnWinupd
776 * to be added to hrngUpdate at the end. */
777 hrgnTemp = CreateRectRgn( 0, 0, 0, 0 );
778 retVal = GetUpdateRgn( hwnd, hrgnTemp, FALSE );
779 if (retVal != NULLREGION)
781 HRGN hrgnClip = CreateRectRgnIndirect(&cliprc);
783 hrgnWinupd = CreateRectRgn( 0, 0, 0, 0);
784 CombineRgn( hrgnWinupd, hrgnTemp, 0, RGN_COPY);
786 OffsetRgn( hrgnTemp, dx, dy );
787 CombineRgn( hrgnTemp, hrgnTemp, hrgnClip, RGN_AND );
789 CombineRgn( hrgnWinupd, hrgnWinupd, hrgnTemp, RGN_OR );
790 RedrawWindow( hwnd, NULL, hrgnTemp, rdw_flags);
791 DeleteObject( hrgnClip );
793 DeleteObject( hrgnTemp );
795 /* nothing was scrolled */
797 SetRectRgn( hrgnUpdate, 0, 0, 0, 0 );
798 SetRectEmpty( rcUpdate);
801 if( flags & SW_SCROLLCHILDREN )
803 HWND *list = WIN_ListChildren( hwnd );
808 for (i = 0; list[i]; i++)
810 GetWindowRect( list[i], &r );
811 MapWindowPoints( 0, hwnd, (POINT *)&r, 2 );
812 if (!rect || IntersectRect(&dummy, &r, rect))
813 SetWindowPos( list[i], 0, r.left + dx, r.top + dy, 0, 0,
814 SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
815 SWP_NOREDRAW | SWP_DEFERERASE );
817 HeapFree( GetProcessHeap(), 0, list );
821 if( flags & (SW_INVALIDATE | SW_ERASE) )
822 RedrawWindow( hwnd, NULL, hrgnUpdate, rdw_flags |
823 ((flags & SW_SCROLLCHILDREN) ? RDW_ALLCHILDREN : 0 ) );
826 CombineRgn( hrgnUpdate, hrgnUpdate, hrgnWinupd, RGN_OR);
827 DeleteObject( hrgnWinupd);
831 SetCaretPos( caretrc.left + dx, caretrc.top + dy );
832 ShowCaret(hwndCaret);
835 if( bOwnRgn && hrgnUpdate ) DeleteObject( hrgnUpdate );
841 /*************************************************************************
842 * ScrollWindow (USER32.@)
845 BOOL WINAPI ScrollWindow( HWND hwnd, INT dx, INT dy,
846 const RECT *rect, const RECT *clipRect )
848 return (ERROR != ScrollWindowEx( hwnd, dx, dy, rect, clipRect, 0, NULL,
849 (rect ? 0 : SW_SCROLLCHILDREN) |
850 SW_INVALIDATE | SW_ERASE ));
854 /*************************************************************************
855 * ScrollDC (USER32.@)
857 * dx, dy, lprcScroll and lprcClip are all in logical coordinates (msdn is
858 * wrong) hrgnUpdate is returned in device coordinates with rcUpdate in
859 * logical coordinates.
861 BOOL WINAPI ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll,
862 const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate )
865 if (USER_Driver.pScrollDC)
866 return USER_Driver.pScrollDC( hdc, dx, dy, lprcScroll, lprcClip, hrgnUpdate, lprcUpdate );