win32u: Move NtUserMoveWindow implementation from user32.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-03-10 14:32:16 +01:00 committed by Alexandre Julliard
parent b308b9cb31
commit a34032b0f0
10 changed files with 45 additions and 36 deletions

View File

@ -1229,8 +1229,8 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
SetRect(&rect, 0, 0, LOWORD(lParam), HIWORD(lParam)); SetRect(&rect, 0, 0, LOWORD(lParam), HIWORD(lParam));
AdjustWindowRectEx(&rect, GetWindowLongA(ci->hwndActiveChild, GWL_STYLE), AdjustWindowRectEx(&rect, GetWindowLongA(ci->hwndActiveChild, GWL_STYLE),
0, GetWindowLongA(ci->hwndActiveChild, GWL_EXSTYLE) ); 0, GetWindowLongA(ci->hwndActiveChild, GWL_EXSTYLE) );
MoveWindow(ci->hwndActiveChild, rect.left, rect.top, NtUserMoveWindow( ci->hwndActiveChild, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top, 1); rect.right - rect.left, rect.bottom - rect.top, 1 );
} }
else else
MDI_PostUpdate(hwnd, ci, SB_BOTH+1); MDI_PostUpdate(hwnd, ci, SB_BOTH+1);
@ -1348,7 +1348,7 @@ LRESULT WINAPI DefFrameProcW( HWND hwnd, HWND hwndMDIClient,
break; break;
case WM_SIZE: case WM_SIZE:
MoveWindow(hwndMDIClient, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE); NtUserMoveWindow( hwndMDIClient, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE );
break; break;
case WM_NEXTMENU: case WM_NEXTMENU:

View File

@ -1173,35 +1173,35 @@ static void SCROLL_CreateScrollBar(HWND hwnd, LPCREATESTRUCTW lpCreate)
if (lpCreate->style & (SBS_SIZEGRIP | SBS_SIZEBOX)) if (lpCreate->style & (SBS_SIZEGRIP | SBS_SIZEBOX))
{ {
if (lpCreate->style & SBS_SIZEBOXTOPLEFTALIGN) if (lpCreate->style & SBS_SIZEBOXTOPLEFTALIGN)
MoveWindow( hwnd, lpCreate->x, lpCreate->y, GetSystemMetrics(SM_CXVSCROLL)+1, NtUserMoveWindow( hwnd, lpCreate->x, lpCreate->y, GetSystemMetrics(SM_CXVSCROLL)+1,
GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); GetSystemMetrics(SM_CYHSCROLL)+1, FALSE );
else if(lpCreate->style & SBS_SIZEBOXBOTTOMRIGHTALIGN) else if(lpCreate->style & SBS_SIZEBOXBOTTOMRIGHTALIGN)
MoveWindow( hwnd, lpCreate->x+lpCreate->cx-GetSystemMetrics(SM_CXVSCROLL)-1, NtUserMoveWindow( hwnd, lpCreate->x+lpCreate->cx-GetSystemMetrics(SM_CXVSCROLL)-1,
lpCreate->y+lpCreate->cy-GetSystemMetrics(SM_CYHSCROLL)-1, lpCreate->y+lpCreate->cy-GetSystemMetrics(SM_CYHSCROLL)-1,
GetSystemMetrics(SM_CXVSCROLL)+1, GetSystemMetrics(SM_CXVSCROLL)+1,
GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); GetSystemMetrics(SM_CYHSCROLL)+1, FALSE );
} }
else if (lpCreate->style & SBS_VERT) else if (lpCreate->style & SBS_VERT)
{ {
if (lpCreate->style & SBS_LEFTALIGN) if (lpCreate->style & SBS_LEFTALIGN)
MoveWindow( hwnd, lpCreate->x, lpCreate->y, NtUserMoveWindow( hwnd, lpCreate->x, lpCreate->y,
GetSystemMetrics(SM_CXVSCROLL)+1, lpCreate->cy, FALSE ); GetSystemMetrics(SM_CXVSCROLL)+1, lpCreate->cy, FALSE );
else if (lpCreate->style & SBS_RIGHTALIGN) else if (lpCreate->style & SBS_RIGHTALIGN)
MoveWindow( hwnd, NtUserMoveWindow( hwnd,
lpCreate->x+lpCreate->cx-GetSystemMetrics(SM_CXVSCROLL)-1, lpCreate->x+lpCreate->cx-GetSystemMetrics(SM_CXVSCROLL)-1,
lpCreate->y, lpCreate->y,
GetSystemMetrics(SM_CXVSCROLL)+1, lpCreate->cy, FALSE ); GetSystemMetrics(SM_CXVSCROLL)+1, lpCreate->cy, FALSE );
} }
else /* SBS_HORZ */ else /* SBS_HORZ */
{ {
if (lpCreate->style & SBS_TOPALIGN) if (lpCreate->style & SBS_TOPALIGN)
MoveWindow( hwnd, lpCreate->x, lpCreate->y, NtUserMoveWindow( hwnd, lpCreate->x, lpCreate->y,
lpCreate->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); lpCreate->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE );
else if (lpCreate->style & SBS_BOTTOMALIGN) else if (lpCreate->style & SBS_BOTTOMALIGN)
MoveWindow( hwnd, NtUserMoveWindow( hwnd,
lpCreate->x, lpCreate->x,
lpCreate->y+lpCreate->cy-GetSystemMetrics(SM_CYHSCROLL)-1, lpCreate->y+lpCreate->cy-GetSystemMetrics(SM_CYHSCROLL)-1,
lpCreate->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE ); lpCreate->cx, GetSystemMetrics(SM_CYHSCROLL)+1, FALSE );
} }
} }

View File

@ -542,7 +542,7 @@
@ stdcall MonitorFromPoint(int64 long) @ stdcall MonitorFromPoint(int64 long)
@ stdcall MonitorFromRect(ptr long) @ stdcall MonitorFromRect(ptr long)
@ stdcall MonitorFromWindow(long long) @ stdcall MonitorFromWindow(long long)
@ stdcall MoveWindow(long long long long long long) @ stdcall MoveWindow(long long long long long long) NtUserMoveWindow
@ stdcall MsgWaitForMultipleObjects(long ptr long long long) @ stdcall MsgWaitForMultipleObjects(long ptr long long long)
@ stdcall MsgWaitForMultipleObjectsEx(long ptr long long long) @ stdcall MsgWaitForMultipleObjectsEx(long ptr long long long)
@ stdcall NotifyWinEvent(long long long long) NtUserNotifyWinEvent @ stdcall NotifyWinEvent(long long long long) NtUserNotifyWinEvent

View File

@ -561,19 +561,6 @@ BOOL WINAPI BringWindowToTop( HWND hwnd )
} }
/***********************************************************************
* MoveWindow (USER32.@)
*/
BOOL WINAPI MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
BOOL repaint )
{
int flags = SWP_NOZORDER | SWP_NOACTIVATE;
if (!repaint) flags |= SWP_NOREDRAW;
TRACE("%p %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint );
return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
}
/******************************************************************* /*******************************************************************
* get_work_rect * get_work_rect
* *

View File

@ -1177,6 +1177,7 @@ static struct unix_funcs unix_funcs =
NtUserGetUpdatedClipboardFormats, NtUserGetUpdatedClipboardFormats,
NtUserIsClipboardFormatAvailable, NtUserIsClipboardFormatAvailable,
NtUserMapVirtualKeyEx, NtUserMapVirtualKeyEx,
NtUserMoveWindow,
NtUserRegisterClassExWOW, NtUserRegisterClassExWOW,
NtUserRegisterHotKey, NtUserRegisterHotKey,
NtUserScrollDC, NtUserScrollDC,

View File

@ -1084,7 +1084,7 @@
@ stub NtUserMinMaximize @ stub NtUserMinMaximize
@ stub NtUserModifyUserStartupInfoFlags @ stub NtUserModifyUserStartupInfoFlags
@ stub NtUserModifyWindowTouchCapability @ stub NtUserModifyWindowTouchCapability
@ stub NtUserMoveWindow @ stdcall NtUserMoveWindow(long long long long long long)
@ stub NtUserMsgWaitForMultipleObjectsEx @ stub NtUserMsgWaitForMultipleObjectsEx
@ stub NtUserNavigateFocus @ stub NtUserNavigateFocus
@ stub NtUserNotifyIMEStatus @ stub NtUserNotifyIMEStatus

View File

@ -218,6 +218,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserGetUpdatedClipboardFormats)( UINT *formats, UINT size, UINT *out_size ); BOOL (WINAPI *pNtUserGetUpdatedClipboardFormats)( UINT *formats, UINT size, UINT *out_size );
BOOL (WINAPI *pNtUserIsClipboardFormatAvailable)( UINT format ); BOOL (WINAPI *pNtUserIsClipboardFormatAvailable)( UINT format );
UINT (WINAPI *pNtUserMapVirtualKeyEx)( UINT code, UINT type, HKL layout ); UINT (WINAPI *pNtUserMapVirtualKeyEx)( UINT code, UINT type, HKL layout );
BOOL (WINAPI *pNtUserMoveWindow)( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint );
ATOM (WINAPI *pNtUserRegisterClassExWOW)( const WNDCLASSEXW *wc, UNICODE_STRING *name, ATOM (WINAPI *pNtUserRegisterClassExWOW)( const WNDCLASSEXW *wc, UNICODE_STRING *name,
UNICODE_STRING *version, UNICODE_STRING *version,
struct client_menu_name *client_menu_name, struct client_menu_name *client_menu_name,

View File

@ -1276,6 +1276,17 @@ BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT
return user_callbacks && user_callbacks->pSetWindowPos( hwnd, after, x, y, cx, cy, flags ); return user_callbacks && user_callbacks->pSetWindowPos( hwnd, after, x, y, cx, cy, flags );
} }
/***********************************************************************
* NtUserMoveWindow (win32u.@)
*/
BOOL WINAPI NtUserMoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint )
{
int flags = SWP_NOZORDER | SWP_NOACTIVATE;
if (!repaint) flags |= SWP_NOREDRAW;
TRACE( "%p %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint );
return NtUserSetWindowPos( hwnd, 0, x, y, cx, cy, flags );
}
/***************************************************************************** /*****************************************************************************
* NtUserGetLayeredWindowAttributes (win32u.@) * NtUserGetLayeredWindowAttributes (win32u.@)
*/ */

View File

@ -840,6 +840,12 @@ INT WINAPI NtUserGetKeyNameText( LONG lparam, WCHAR *buffer, INT size )
return unix_funcs->pNtUserGetKeyNameText( lparam, buffer, size ); return unix_funcs->pNtUserGetKeyNameText( lparam, buffer, size );
} }
BOOL WINAPI NtUserMoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserMoveWindow( hwnd, x, y, cx, cy, repaint );
}
INT WINAPI NtUserGetPriorityClipboardFormat( UINT *list, INT count ) INT WINAPI NtUserGetPriorityClipboardFormat( UINT *list, INT count )
{ {
if (!unix_funcs) return 0; if (!unix_funcs) return 0;

View File

@ -340,6 +340,9 @@ NTSTATUS WINAPI NtUserInitializeClientPfnArrays( const struct user_client_procs
INT WINAPI NtUserInternalGetWindowText( HWND hwnd, WCHAR *text, INT count ); INT WINAPI NtUserInternalGetWindowText( HWND hwnd, WCHAR *text, INT count );
BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format ); BOOL WINAPI NtUserIsClipboardFormatAvailable( UINT format );
UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout ); UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout );
BOOL WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
ULONG_PTR result_info, DWORD type, BOOL ansi );
BOOL WINAPI NtUserMoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy, BOOL repaint );
void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG child_id ); void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG child_id );
HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access ); HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access );
BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ); BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len );