Author: jimtabor Date: Wed Feb 22 17:45:19 2017 New Revision: 73887
URL: http://svn.reactos.org/svn/reactos?rev=73887&view=rev Log: [Win32SS] - Implement Fill Window, for testing.
Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c trunk/reactos/win32ss/user/ntuser/painting.c trunk/reactos/win32ss/user/ntuser/userfuncs.h
Modified: trunk/reactos/win32ss/user/ntuser/ntstubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/ntstubs... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/ntstubs.c [iso-8859-1] Wed Feb 22 17:45:19 2017 @@ -953,23 +953,6 @@ }
/* - * FillWindow: Called from User; Dialog, Edit and ListBox procs during a WM_ERASEBKGND. - */ -/* - * @unimplemented - */ -BOOL APIENTRY -NtUserFillWindow(HWND hWndPaint, - HWND hWndPaint1, - HDC hDC, - HBRUSH hBrush) -{ - STUB - - return 0; -} - -/* * @unimplemented */ BOOL APIENTRY
Modified: trunk/reactos/win32ss/user/ntuser/painting.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/paintin... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/painting.c [iso-8859-1] Wed Feb 22 17:45:19 2017 @@ -1555,6 +1555,50 @@ return TRUE; }
+BOOL FASTCALL +IntFillWindow(PWND pWndParent, + PWND pWnd, + HDC hDC, + HBRUSH hBrush) +{ + RECT Rect, Rect1; + INT type; + + if (!pWndParent) + pWndParent = pWnd; + + type = GdiGetClipBox(hDC, &Rect); + + IntGetClientRect(pWnd, &Rect1); + + if ( type != NULLREGION && // Clip box is not empty, + (!(pWnd->pcls->style & CS_PARENTDC) || // not parent dc or + RECTL_bIntersectRect( &Rect, &Rect, &Rect1) ) ) // intersecting. + { + POINT ppt; + INT x = 0, y = 0; + + if ( pWndParent != UserGetDesktopWindow()) + { + x = pWndParent->rcClient.left - pWnd->rcClient.left; + y = pWndParent->rcClient.top - pWnd->rcClient.top; + } + + GreSetBrushOrg(hDC, x, y, &ppt); + + if ( hBrush < (HBRUSH)CTLCOLOR_MAX ) + hBrush = GetControlColor( pWndParent, pWnd, hDC, HandleToUlong(hBrush) + WM_CTLCOLORMSGBOX); + + FillRect(hDC, &Rect, hBrush); + + GreSetBrushOrg(hDC, ppt.x, ppt.y, NULL); + + return TRUE; + } + else + return FALSE; +} + /* PUBLIC FUNCTIONS ***********************************************************/
/* @@ -1653,6 +1697,50 @@ TRACE("Leave NtUserEndPaint, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; +} + +/* + * FillWindow: Called from User; Dialog, Edit and ListBox procs during a WM_ERASEBKGND. + */ +/* + * @implemented + */ +BOOL APIENTRY +NtUserFillWindow(HWND hWndParent, + HWND hWnd, + HDC hDC, + HBRUSH hBrush) +{ + BOOL ret = FALSE; + PWND pWnd, pWndParent = NULL; + USER_REFERENCE_ENTRY Ref; + + TRACE("Enter NtUserFillWindow\n"); + UserEnterExclusive(); + + if (!hDC) + { + goto Exit; + } + + if (!(pWnd = UserGetWindowObject(hWnd))) + { + goto Exit; + } + + if (hWndParent && !(pWndParent = UserGetWindowObject(hWndParent))) + { + goto Exit; + } + + UserRefObjectCo(pWnd, &Ref); + ret = IntFillWindow( pWndParent, pWnd, hDC, hBrush ); + UserDerefObjectCo(pWnd); + +Exit: + TRACE("Leave NtUserFillWindow, ret=%i\n",ret); + UserLeave(); + return ret; }
/*
Modified: trunk/reactos/win32ss/user/ntuser/userfuncs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/userfun... ============================================================================== --- trunk/reactos/win32ss/user/ntuser/userfuncs.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/userfuncs.h [iso-8859-1] Wed Feb 22 17:45:19 2017 @@ -102,7 +102,8 @@ VOID FASTCALL IntSetWindowState(PWND, UINT); VOID FASTCALL IntClearWindowState(PWND, UINT); PTHREADINFO FASTCALL IntTID2PTI(HANDLE); -HBRUSH FASTCALL GetControlBrush(PWND pwnd,HDC hdc,UINT ctlType); +HBRUSH FASTCALL GetControlBrush(PWND,HDC,UINT); +HBRUSH FASTCALL GetControlColor(PWND,PWND,HDC,UINT);
/*************** MESSAGE.C ***************/