Implementation of ChildWindowFromPointEx functions.

diff --git a/if1632/user.spec b/if1632/user.spec
index 0bdf676..b7801e7 100644
--- a/if1632/user.spec
+++ b/if1632/user.spec
@@ -366,7 +366,7 @@
 395 stub GetIconInfo
 397 pascal16 RegisterClassEx(ptr) RegisterClassEx16
 398 pascal16 GetClassInfoEx(word segstr ptr) GetClassInfoEx16
-399 stub ChildWindowFromPointEx
+399 pascal16 ChildWindowFromPointEx(word long word) ChildWindowFromPointEx16
 400 stub FinalUserInit
 402 pascal16 GetPriorityClipboardFormat(ptr s_word) GetPriorityClipboardFormat16
 403 pascal16 UnregisterClass(segstr word) UnregisterClass16
diff --git a/include/windows.h b/include/windows.h
index 19c23af..b3baeb6 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -3882,6 +3882,12 @@
 #define CW_USEDEFAULT32 ((INT32)0x80000000)
 #define CW_USEDEFAULT   WINELIB_NAME(CW_USEDEFAULT)
 
+/* ChildWindowFromPointEx Flags */
+#define CWP_ALL                0x0000
+#define CWP_SKIPINVISIBLE      0x0001
+#define CWP_SKIPDISABLED       0x0002
+#define CWP_SKIPTRANSPARENT    0x0004
+
 /* Button control styles */
 #define BS_PUSHBUTTON          0x00000000L
 #define BS_DEFPUSHBUTTON       0x00000001L
@@ -7329,6 +7335,9 @@
 HWND16      WINAPI ChildWindowFromPoint16(HWND16,POINT16);
 HWND32      WINAPI ChildWindowFromPoint32(HWND32,POINT32);
 #define     ChildWindowFromPoint WINELIB_NAME(ChildWindowFromPoint)
+HWND16      WINAPI ChildWindowFromPointEx16(HWND16,POINT16,UINT16);
+HWND32      WINAPI ChildWindowFromPointEx32(HWND32,POINT32,UINT32);
+#define     ChildWindowFromPointEx WINELIB_NAME(ChildWindowFromPointEx)
 INT32       WINAPI ChoosePixelFormat(HDC32,const PIXELFORMATDESCRIPTOR*);
 BOOL16      WINAPI Chord16(HDC16,INT16,INT16,INT16,INT16,INT16,INT16,INT16,INT16);
 BOOL32      WINAPI Chord32(HDC32,INT32,INT32,INT32,INT32,INT32,INT32,INT32,INT32);
diff --git a/relay32/user32.spec b/relay32/user32.spec
index 5707fd2..e06620a 100644
--- a/relay32/user32.spec
+++ b/relay32/user32.spec
@@ -51,7 +51,7 @@
  47 stdcall CheckMenuRadioItem(long long long long long) CheckMenuRadioItem32
  48 stdcall CheckRadioButton(long long long long) CheckRadioButton32
  49 stdcall ChildWindowFromPoint(long long long) ChildWindowFromPoint32
- 50 stub ChildWindowFromPointEx
+ 50 stdcall ChildWindowFromPointEx(long long long long) ChildWindowFromPointEx32
  51 stub ClientThreadConnect
  52 stdcall ClientToScreen(long ptr) ClientToScreen32
  53 stdcall ClipCursor(ptr) ClipCursor32
diff --git a/windows/winpos.c b/windows/winpos.c
index 7625c33..de2e46e 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -497,6 +497,57 @@
     return hwndParent;
 }
 
+/*******************************************************************
+ *         ChildWindowFromPointEx16   (USER.50)
+ */
+HWND16 WINAPI ChildWindowFromPointEx16( HWND16 hwndParent, POINT16 pt, UINT16 uFlags)
+{
+    POINT32 pt32;
+    CONV_POINT16TO32( &pt, &pt32 );
+    return (HWND16)ChildWindowFromPointEx32( hwndParent, pt32, uFlags );
+}
+
+
+/*******************************************************************
+ *         ChildWindowFromPointEx32   (USER32.50)
+ */
+HWND32 WINAPI ChildWindowFromPointEx32( HWND32 hwndParent, POINT32 pt,
+		UINT32 uFlags)
+{
+    /* pt is in the client coordinates */
+
+    WND* wnd = WIN_FindWndPtr(hwndParent);
+    RECT32 rect;
+
+    if( !wnd ) return 0;
+
+    /* get client rect fast */
+    rect.top = rect.left = 0;
+    rect.right = wnd->rectClient.right - wnd->rectClient.left;
+    rect.bottom = wnd->rectClient.bottom - wnd->rectClient.top;
+
+    if (!PtInRect32( &rect, pt )) return 0;
+
+    wnd = wnd->child;
+    while ( wnd )
+    {
+        if (PtInRect32( &wnd->rectWindow, pt )) {
+		if ( (uFlags & CWP_SKIPINVISIBLE) && 
+				!(wnd->dwStyle & WS_VISIBLE) )
+		        wnd = wnd->next;
+		else if ( (uFlags & CWP_SKIPDISABLED) && 
+				(wnd->dwStyle & WS_DISABLED) )
+		        wnd = wnd->next;
+		else if ( (uFlags & CWP_SKIPTRANSPARENT) && 
+				(wnd->dwExStyle & WS_EX_TRANSPARENT) )
+		        wnd = wnd->next;
+		else
+			return wnd->hwndSelf;
+	}
+    }
+    return hwndParent;
+}
+
 
 /*******************************************************************
  *         WINPOS_GetWinOffset