user32: Remove no longer used WINPOS_WindowFromPoint.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
781b954424
commit
e2d79b395d
|
@ -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;
|
||||
|
||||
|
|
|
@ -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.@)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue