diff --git a/dlls/user32/win.h b/dlls/user32/win.h index c9ac3b8e977..2155ea51e94 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -60,7 +60,6 @@ static inline void WIN_ReleasePtr( WND *ptr ) extern LRESULT HOOK_CallHooks( INT id, INT code, WPARAM wparam, LPARAM lparam, BOOL unicode ) DECLSPEC_HIDDEN; -extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DECLSPEC_HIDDEN; extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN; extern void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam ) DECLSPEC_HIDDEN; diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index a5bc7d9ce17..5987d06c257 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -109,101 +109,6 @@ BOOL WINAPI GetClientRect( HWND hwnd, LPRECT rect ) } -/*********************************************************************** - * list_children_from_point - * - * Get the list of children that can contain point from the server. - * Point is in screen coordinates. - * Returned list must be freed by caller. - */ -static HWND *list_children_from_point( HWND hwnd, POINT pt ) -{ - HWND *list; - int i, size = 128; - - for (;;) - { - int count = 0; - - if (!(list = HeapAlloc( GetProcessHeap(), 0, size * sizeof(HWND) ))) break; - - SERVER_START_REQ( get_window_children_from_point ) - { - req->parent = wine_server_user_handle( hwnd ); - req->x = pt.x; - req->y = pt.y; - req->dpi = get_thread_dpi(); - wine_server_set_reply( req, list, (size-1) * sizeof(user_handle_t) ); - if (!wine_server_call( req )) count = reply->count; - } - SERVER_END_REQ; - if (count && count < size) - { - /* start from the end since HWND is potentially larger than user_handle_t */ - for (i = count - 1; i >= 0; i--) - list[i] = wine_server_ptr_handle( ((user_handle_t *)list)[i] ); - list[count] = 0; - return list; - } - HeapFree( GetProcessHeap(), 0, list ); - if (!count) break; - size = count + 1; /* restart with a large enough buffer */ - } - return NULL; -} - - -/*********************************************************************** - * WINPOS_WindowFromPoint - * - * Find the window and hittest for a given point. - */ -HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) -{ - int i, res; - HWND ret, *list; - POINT win_pt; - - if (!hwndScope) hwndScope = GetDesktopWindow(); - - *hittest = HTNOWHERE; - - if (!(list = list_children_from_point( hwndScope, pt ))) return 0; - - /* now determine the hittest */ - - for (i = 0; list[i]; i++) - { - LONG style = GetWindowLongW( list[i], GWL_STYLE ); - - /* If window is minimized or disabled, return at once */ - if (style & WS_DISABLED) - { - *hittest = HTERROR; - break; - } - /* Send WM_NCCHITTEST (if same thread) */ - if (!WIN_IsCurrentThread( list[i] )) - { - *hittest = HTCLIENT; - break; - } - win_pt = point_thread_to_win_dpi( list[i], pt ); - res = SendMessageW( list[i], WM_NCHITTEST, 0, MAKELPARAM( win_pt.x, win_pt.y )); - if (res != HTTRANSPARENT) - { - *hittest = res; /* Found the window */ - break; - } - /* continue search with next window in z-order */ - } - ret = list[i]; - HeapFree( GetProcessHeap(), 0, list ); - TRACE( "scope %p (%d,%d) returning %p\n", hwndScope, pt.x, pt.y, ret ); - return ret; -} - - /******************************************************************* * WindowFromPoint (USER32.@) */