diff --git a/include/dce.h b/include/dce.h
index 506bfedacf29a57c522e6ba6c0df715b8dc630da..96db5d1123773f53261c4fad8a6b5f2fe5f7fc6e 100644
--- a/include/dce.h
+++ b/include/dce.h
@@ -51,7 +51,7 @@ extern DCE*  DCE_AllocDCE( HWND32 hWnd, DCE_TYPE type );
 extern DCE*  DCE_FreeDCE( DCE *dce );
 extern void  DCE_FreeWindowDCE( WND* );
 extern INT16 DCE_ExcludeRgn( HDC32, WND*, HRGN32 );
-extern HRGN32 DCE_GetVisRgn( HWND32, WORD );
+extern HRGN32 DCE_GetVisRgn( HWND32, WORD, HWND32, WORD );
 extern BOOL32 DCE_InvalidateDCE( WND*, const RECT32* );
 
 #endif  /* __WINE_DCE_H */
diff --git a/windows/dce.c b/windows/dce.c
index a47d0e0aad79fd90a8cd911c0b6efa995770d2fc..8aee87eac7b79fba63fbc088bc349fabf692f59b 100644
--- a/windows/dce.c
+++ b/windows/dce.c
@@ -410,11 +410,12 @@ static BOOL32 DCE_AddClipRects( WND *pWndStart, WND *pWndEnd,
  * clipped by the client area of all ancestors, and then optionally
  * by siblings and children.
  */
-HRGN32 DCE_GetVisRgn( HWND32 hwnd, WORD flags )
+HRGN32 DCE_GetVisRgn( HWND32 hwnd, WORD flags, HWND32 hwndChild, WORD cflags )
 {
     HRGN32 hrgnVis = 0;
     RECT32 rect;
     WND *wndPtr = WIN_FindWndPtr( hwnd );
+    WND *childWnd = WIN_FindWndPtr( hwndChild );
 
     /* Get visible rectangle and create a region with it. */
 
@@ -449,6 +450,32 @@ HRGN32 DCE_GetVisRgn( HWND32 hwnd, WORD flags )
 				      &rect, xoffset, yoffset );
 		}
 
+		/* We may need to clip children of child window, if a window with PARENTDC
+		 * class style and CLIPCHILDREN window style (like in Free Agent 16
+		 * preference dialogs) gets here, we take the region for the parent window
+		 * but apparently still need to clip the children of the child window... */
+
+		if( (cflags & DCX_CLIPCHILDREN) && childWnd && childWnd->child )
+		{
+		    if( flags & DCX_WINDOW )
+		    {
+			/* adjust offsets since child window rectangles are 
+			 * in client coordinates */
+
+			xoffset = wndPtr->rectClient.left - wndPtr->rectWindow.left;
+			yoffset = wndPtr->rectClient.top - wndPtr->rectWindow.top;
+		    }
+		    else 
+			xoffset = yoffset = 0;
+
+		    /* client coordinates of child window */
+		    xoffset += childWnd->rectClient.left;
+		    yoffset += childWnd->rectClient.top;
+
+		    DCE_AddClipRects( childWnd->child, NULL, hrgnClip, 
+				      &rect, xoffset, yoffset );
+		}
+
 		/* sibling window rectangles are in client 
 		 * coordinates of the parent window */
 
@@ -714,7 +741,8 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags )
 		else
 		    dcxFlags = flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW);
 
-                hrgnVisible = DCE_GetVisRgn( parentPtr->hwndSelf, dcxFlags );
+                hrgnVisible = DCE_GetVisRgn( parentPtr->hwndSelf, dcxFlags,
+                                             wndPtr->hwndSelf, flags );
 		if( flags & DCX_WINDOW )
 		    OffsetRgn32( hrgnVisible, -wndPtr->rectWindow.left,
 					      -wndPtr->rectWindow.top );
@@ -733,7 +761,7 @@ HDC32 WINAPI GetDCEx32( HWND32 hwnd, HRGN32 hrgnClip, DWORD flags )
 						      SYSMETRICS_CYSCREEN );
 	    else 
             {
-                hrgnVisible = DCE_GetVisRgn( hwnd, flags );
+                hrgnVisible = DCE_GetVisRgn( hwnd, flags, 0, 0 );
                 DCE_OffsetVisRgn( hdc, hrgnVisible );
             }
 
@@ -874,7 +902,7 @@ BOOL16 WINAPI DCHook( HDC16 hDC, WORD code, DWORD data, LPARAM lParam )
            if( dce->DCXflags & DCX_DCEBUSY )
  	   {
 	       SetHookFlags(hDC, DCHF_VALIDATEVISRGN);
-	       hVisRgn = DCE_GetVisRgn(dce->hwndCurrent, dce->DCXflags);
+	       hVisRgn = DCE_GetVisRgn(dce->hwndCurrent, dce->DCXflags, 0, 0);
 
 	       TRACE(dc,"\tapplying saved clipRgn\n");
   
diff --git a/windows/winpos.c b/windows/winpos.c
index 7dd7354b2294c3cf25c9c9171e2e296baa23bcc5..7a4ff6ae5a77d5804b14f3df01ed472418e223ff 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -2045,7 +2045,7 @@ static UINT32 WINPOS_SizeMoveClean( WND* Wnd, HRGN32 oldVisRgn,
                                     LPRECT32 lpOldWndRect,
                                     LPRECT32 lpOldClientRect, UINT32 uFlags )
 {
- HRGN32 newVisRgn = DCE_GetVisRgn(Wnd->hwndSelf,DCX_WINDOW | DCX_CLIPSIBLINGS);
+ HRGN32 newVisRgn = DCE_GetVisRgn(Wnd->hwndSelf,DCX_WINDOW | DCX_CLIPSIBLINGS,0,0);
  HRGN32 dirtyRgn = CreateRectRgn32(0,0,0,0);
  int  other, my;
 
@@ -2333,7 +2333,7 @@ BOOL32 WINAPI SetWindowPos32( HWND32 hwnd, HWND32 hwndInsertAfter,
     if ( !X11DRV_WND_GetXWindow(wndPtr) && !(winpos.flags & SWP_NOREDRAW) && 
 	((winpos.flags & (SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED)) 
 		      != (SWP_NOMOVE | SWP_NOSIZE)) )
-          visRgn = DCE_GetVisRgn(hwnd, DCX_WINDOW | DCX_CLIPSIBLINGS);
+          visRgn = DCE_GetVisRgn(hwnd, DCX_WINDOW | DCX_CLIPSIBLINGS, 0, 0);
 
       /* Send WM_NCCALCSIZE message to get new client area */
     if( (winpos.flags & (SWP_FRAMECHANGED | SWP_NOSIZE)) != SWP_NOSIZE )