Commit 08b2fbcb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserSetWindowPos implementation from user32.

parent d402df31
......@@ -306,12 +306,12 @@ static void CBForceDummyResize(LPHEADCOMBO lphc)
* message.
*/
lphc->wState |= CBF_NORESIZE;
SetWindowPos( lphc->self,
NULL,
0, 0,
windowRect.right - windowRect.left,
newComboHeight,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
NtUserSetWindowPos( lphc->self,
NULL,
0, 0,
windowRect.right - windowRect.left,
newComboHeight,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
lphc->wState &= ~CBF_NORESIZE;
CBCalcPlacement(lphc);
......@@ -996,8 +996,8 @@ static void CBDropDown( LPHEADCOMBO lphc )
r.bottom = min( r.top + nDroppedHeight, mon_info.rcWork.bottom );
}
SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, r.left, r.top, r.right - r.left, r.bottom - r.top,
SWP_NOACTIVATE | SWP_SHOWWINDOW );
NtUserSetWindowPos( lphc->hWndLBox, HWND_TOPMOST, r.left, r.top, r.right - r.left, r.bottom - r.top,
SWP_NOACTIVATE | SWP_SHOWWINDOW );
if( !(lphc->wState & CBF_NOREDRAW) )
......@@ -1404,15 +1404,15 @@ static void CBResetPos(HEADCOMBO *combo, BOOL redraw)
/* NOTE: logs sometimes have WM_LBUTTONUP before a cascade of
* sizing messages */
if (combo->wState & CBF_EDIT)
SetWindowPos(combo->hWndEdit, 0, combo->textRect.left, combo->textRect.top,
combo->textRect.right - combo->textRect.left,
combo->textRect.bottom - combo->textRect.top,
SWP_NOZORDER | SWP_NOACTIVATE | (drop ? SWP_NOREDRAW : 0));
NtUserSetWindowPos( combo->hWndEdit, 0, combo->textRect.left, combo->textRect.top,
combo->textRect.right - combo->textRect.left,
combo->textRect.bottom - combo->textRect.top,
SWP_NOZORDER | SWP_NOACTIVATE | (drop ? SWP_NOREDRAW : 0) );
SetWindowPos(combo->hWndLBox, 0, combo->droppedRect.left, combo->droppedRect.top,
combo->droppedRect.right - combo->droppedRect.left,
combo->droppedRect.bottom - combo->droppedRect.top,
SWP_NOACTIVATE | SWP_NOZORDER | (drop ? SWP_NOREDRAW : 0));
NtUserSetWindowPos( combo->hWndLBox, 0, combo->droppedRect.left, combo->droppedRect.top,
combo->droppedRect.right - combo->droppedRect.left,
combo->droppedRect.bottom - combo->droppedRect.top,
SWP_NOACTIVATE | SWP_NOZORDER | (drop ? SWP_NOREDRAW : 0) );
if (drop)
{
......@@ -1470,8 +1470,8 @@ static void COMBO_Size( HEADCOMBO *lphc )
if (curComboHeight != newComboHeight)
{
lphc->wState |= CBF_NORESIZE;
SetWindowPos(lphc->self, 0, 0, 0, curComboWidth, newComboHeight,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW);
NtUserSetWindowPos( lphc->self, 0, 0, 0, curComboWidth, newComboHeight,
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW );
lphc->wState &= ~CBF_NORESIZE;
}
}
......
......@@ -691,8 +691,8 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
{
STYLESTRUCT *style = (STYLESTRUCT *)lParam;
if ((style->styleOld ^ style->styleNew) & (WS_CAPTION|WS_THICKFRAME|WS_VSCROLL|WS_HSCROLL))
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER |
SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE );
NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER |
SWP_NOSIZE | SWP_NOMOVE | SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE );
}
break;
......
......@@ -931,8 +931,8 @@ BOOL WINAPI EndDialog( HWND hwnd, INT_PTR retval )
/* Don't have to send a ShowWindow(SW_HIDE), just do
SetWindowPos with SWP_HIDEWINDOW as done in Windows */
SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE
| SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW);
NtUserSetWindowPos( hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE
| SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW );
if (hwnd == GetActiveWindow())
{
......
......@@ -100,9 +100,9 @@ BOOL WINAPI SetShellWindowEx(HWND hwndShell, HWND hwndListView)
return FALSE;
if (hwndListView && hwndListView!=hwndShell)
SetWindowPos(hwndListView, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
NtUserSetWindowPos( hwndListView, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE );
SetWindowPos(hwndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
NtUserSetWindowPos( hwndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE );
SERVER_START_REQ(set_global_windows)
{
......
......@@ -91,7 +91,7 @@ static BOOL ICONTITLE_SetTitlePos( HWND hwnd, HWND owner )
/* point is relative to owner, make it relative to parent */
MapWindowPoints( owner, GetParent(hwnd), &pt, 1 );
SetWindowPos( hwnd, owner, pt.x, pt.y, cx, cy, SWP_NOACTIVATE );
NtUserSetWindowPos( hwnd, owner, pt.x, pt.y, cx, cy, SWP_NOACTIVATE );
return TRUE;
}
......
......@@ -497,9 +497,9 @@ static void LISTBOX_UpdateSize( LB_DESCR *descr )
{
TRACE("[%p]: changing height %d -> %d\n",
descr->self, descr->height, descr->height - remaining );
SetWindowPos( descr->self, 0, 0, 0, rect.right - rect.left,
rect.bottom - rect.top - remaining,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE );
NtUserSetWindowPos( descr->self, 0, 0, 0, rect.right - rect.left,
rect.bottom - rect.top - remaining,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE );
return;
}
}
......
......@@ -518,12 +518,13 @@ static void MDI_SwitchActiveChild( MDICLIENTINFO *ci, HWND hwndTo, BOOL activate
SendMessageW( hwndPrev, WM_SETREDRAW, TRUE, 0 );
/* activate new MDI child */
SetWindowPos( hwndTo, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
NtUserSetWindowPos( hwndTo, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
/* maximize new MDI child */
ShowWindow( hwndTo, SW_MAXIMIZE );
}
/* activate new MDI child */
SetWindowPos( hwndTo, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | (activate ? 0 : SWP_NOACTIVATE) );
NtUserSetWindowPos( hwndTo, HWND_TOP, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | (activate ? 0 : SWP_NOACTIVATE) );
}
}
......@@ -721,8 +722,7 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
style = GetWindowLongW(win_array[i], GWL_STYLE);
if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE;
SetWindowPos( win_array[i], 0, pos[0].x, pos[0].y, pos[1].x, pos[1].y,
posOptions);
NtUserSetWindowPos( win_array[i], 0, pos[0].x, pos[0].y, pos[1].x, pos[1].y, posOptions );
}
}
HeapFree( GetProcessHeap(), 0, win_array );
......@@ -806,7 +806,7 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
LONG style = GetWindowLongW(win_array[i], GWL_STYLE);
if (!(style & WS_SIZEBOX)) posOptions |= SWP_NOSIZE;
SetWindowPos(*pWnd, 0, x, y, xsize, ysize, posOptions);
NtUserSetWindowPos( *pWnd, 0, x, y, xsize, ysize, posOptions );
y += ysize;
pWnd++;
}
......@@ -1017,8 +1017,8 @@ static void MDI_UpdateFrameText( HWND frame, HWND hClient, BOOL repaint, LPCWSTR
DefWindowProcW( frame, WM_SETTEXT, 0, (LPARAM)lpBuffer );
if (repaint)
SetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED |
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER );
NtUserSetWindowPos( frame, 0,0,0,0,0, SWP_FRAMECHANGED |
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER );
}
......@@ -1084,7 +1084,7 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_MDIACTIVATE:
{
if( ci->hwndActiveChild != (HWND)wParam )
SetWindowPos((HWND)wParam, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE);
NtUserSetWindowPos( (HWND)wParam, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
return 0;
}
......@@ -1141,8 +1141,8 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
HWND hwnd = wParam ? WIN_GetFullHandle((HWND)wParam) : ci->hwndActiveChild;
HWND next = MDI_GetWindow( ci, hwnd, !lParam, 0 );
MDI_SwitchActiveChild( ci, next, TRUE );
if(!lParam)
SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
if (!lParam)
NtUserSetWindowPos( hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
break;
}
......@@ -1211,8 +1211,8 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
TRACE("notification from %p (%i,%i)\n",child,pt.x,pt.y);
if( child && child != hwnd && child != ci->hwndActiveChild )
SetWindowPos(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
if (child && child != hwnd && child != ci->hwndActiveChild)
NtUserSetWindowPos( child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
break;
}
......
......@@ -1966,8 +1966,8 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id, UINT flags,
}
/* Display the window */
SetWindowPos( menu->hWnd, HWND_TOPMOST, x, y, menu->Width, menu->Height,
SWP_SHOWWINDOW | SWP_NOACTIVATE );
NtUserSetWindowPos( menu->hWnd, HWND_TOPMOST, x, y, menu->Width, menu->Height,
SWP_SHOWWINDOW | SWP_NOACTIVATE );
UpdateWindow( menu->hWnd );
return TRUE;
}
......@@ -4489,8 +4489,8 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
if(!MENU_SetMenu(hWnd, hMenu))
return FALSE;
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
NtUserSetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return TRUE;
}
......@@ -4540,8 +4540,8 @@ BOOL WINAPI DrawMenuBar( HWND hWnd )
}
}
return SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return NtUserSetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
}
/***********************************************************************
......
......@@ -1861,9 +1861,6 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
{
case WM_WINE_DESTROYWINDOW:
return WIN_DestroyWindow( hwnd );
case WM_WINE_SETWINDOWPOS:
if (is_desktop_window( hwnd )) return 0;
return USER_SetWindowPos( (WINDOWPOS *)lparam, 0, 0 );
case WM_WINE_SHOWWINDOW:
if (is_desktop_window( hwnd )) return 0;
return ShowWindow( hwnd, wparam );
......
......@@ -281,16 +281,16 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
wtop = (mon_info.rcWork.top + mon_info.rcWork.bottom - wheight) / 2;
/* Resize and center the window */
SetWindowPos(hwnd, 0, wleft, wtop, wwidth, wheight,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
NtUserSetWindowPos( hwnd, 0, wleft, wtop, wwidth, wheight,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
/* Position the icon */
SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
NtUserSetWindowPos( GetDlgItem(hwnd, MSGBOX_IDICON), 0, ileft, (tiheight - iheight) / 2, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
/* Position the text */
SetWindowPos(GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW);
NtUserSetWindowPos( GetDlgItem(hwnd, MSGBOX_IDTEXT), 0, tleft, (tiheight - theight) / 2, twidth, theight,
SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW );
/* Position the buttons */
bpos = (wwidth - (bw + bspace) * buttons + bspace) / 2;
......@@ -303,15 +303,15 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
NtUserSetFocus(hItem);
SendMessageW( hItem, BM_SETSTYLE, BS_DEFPUSHBUTTON, TRUE );
}
SetWindowPos(hItem, 0, bpos, tiheight, bw, bh,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW);
NtUserSetWindowPos( hItem, 0, bpos, tiheight, bw, bh,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOREDRAW );
bpos += bw + bspace;
}
}
/*handle modal message boxes*/
if (((lpmb->dwStyle & MB_TASKMODAL) && (lpmb->hwndOwner==NULL)) || (lpmb->dwStyle & MB_SYSTEMMODAL))
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
NtUserSetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE );
HeapFree( GetProcessHeap(), 0, buffer );
}
......
......@@ -802,9 +802,9 @@ static INT scroll_window( HWND hwnd, INT dx, INT dy, const RECT *rect, const REC
{
WIN_GetRectangles( list[i], COORDS_PARENT, &r, NULL );
if (!rect || IntersectRect(&dummy, &r, rect))
SetWindowPos( list[i], 0, r.left + dx, r.top + dy, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
SWP_NOREDRAW | SWP_DEFERERASE );
NtUserSetWindowPos( list[i], 0, r.left + dx, r.top + dy, 0, 0,
SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE |
SWP_NOREDRAW | SWP_DEFERERASE );
}
HeapFree( GetProcessHeap(), 0, list );
}
......
......@@ -1995,8 +1995,8 @@ static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, BOOL fShowH, BOOL fShowV
if ((old_style & clear_bits) != 0 || (old_style & set_bits) != set_bits)
{
/* frame has been changed, let the window redraw itself */
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE
| SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return TRUE;
}
return FALSE; /* no frame changes */
......
......@@ -122,7 +122,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
}
else */
{
SetWindowPos( hwnd, 0, 0, 0, size.cx, size.cy, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
NtUserSetWindowPos( hwnd, 0, 0, 0, size.cx, size.cy, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
}
}
return prevIcon;
......@@ -157,8 +157,8 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
}
else */
{
SetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
NtUserSetWindowPos( hwnd, 0, 0, 0, bm.bmWidth, bm.bmHeight,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER );
}
}
......@@ -425,7 +425,8 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
else
rc.right = rc.left;
AdjustWindowRectEx(&rc, full_style, FALSE, GetWindowLongW(hwnd, GWL_EXSTYLE));
SetWindowPos(hwnd, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
NtUserSetWindowPos( hwnd, NULL, 0, 0, rc.right - rc.left, rc.bottom - rc.top,
SWP_NOMOVE | SWP_NOZORDER );
}
switch (style) {
......
......@@ -725,7 +725,7 @@
@ stdcall -arch=win64 SetWindowLongPtrW(long long long)
@ stdcall SetWindowLongW(long long long)
@ stdcall SetWindowPlacement(long ptr)
@ stdcall SetWindowPos(long long long long long long long)
@ stdcall SetWindowPos(long long long long long long long) NtUserSetWindowPos
@ stdcall SetWindowRgn(long long long) NtUserSetWindowRgn
@ stdcall SetWindowStationUser(long long)
@ stdcall SetWindowTextA(long str)
......
......@@ -149,7 +149,6 @@ static const struct user_callbacks user_funcs =
SendMessageTimeoutW,
SendMessageW,
SendNotifyMessageW,
SetWindowPos,
ShowCaret,
WaitForInputIdle,
notify_ime,
......
......@@ -88,12 +88,6 @@ static inline struct user_thread_info *get_user_thread_info(void)
return (struct user_thread_info *)NtCurrentTeb()->Win32ClientInfo;
}
/* check if hwnd is a broadcast magic handle */
static inline BOOL is_broadcast( HWND hwnd )
{
return (hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST);
}
extern HMODULE user32_module DECLSPEC_HIDDEN;
struct dce;
......
......@@ -1561,8 +1561,8 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
swFlag = WINPOS_MinMaximize( hwnd, swFlag, &newPos );
swFlag |= SWP_FRAMECHANGED; /* Frame always gets changed */
if (!(style & WS_VISIBLE) || (style & WS_CHILD) || GetActiveWindow()) swFlag |= SWP_NOACTIVATE;
SetWindowPos( hwnd, 0, newPos.left, newPos.top, newPos.right - newPos.left,
newPos.bottom - newPos.top, swFlag );
NtUserSetWindowPos( hwnd, 0, newPos.left, newPos.top, newPos.right - newPos.left,
newPos.bottom - newPos.top, swFlag );
}
/* Notify the parent window only */
......@@ -1589,7 +1589,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
{
SendMessageW(cs->hwndParent, WM_MDIREFRESHMENU, 0, 0);
/* ShowWindow won't activate child windows */
SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE );
NtUserSetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE );
}
}
......@@ -1761,8 +1761,8 @@ BOOL WINAPI DestroyWindow( HWND hwnd )
if (is_child)
ShowWindow( hwnd, SW_HIDE );
else
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW );
NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |
SWP_NOZORDER | SWP_NOACTIVATE | SWP_HIDEWINDOW );
}
if (!IsWindow(hwnd)) return TRUE;
......
......@@ -519,7 +519,7 @@ BOOL WINAPI LockSetForegroundWindow( UINT lockcode )
*/
BOOL WINAPI BringWindowToTop( HWND hwnd )
{
return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
return NtUserSetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
}
......@@ -1000,8 +1000,8 @@ static BOOL show_window( HWND hwnd, INT cmd )
else WIN_SetStyle( hwnd, 0, WS_VISIBLE );
}
else
SetWindowPos( hwnd, HWND_TOP, newPos.left, newPos.top,
newPos.right - newPos.left, newPos.bottom - newPos.top, swp );
NtUserSetWindowPos( hwnd, HWND_TOP, newPos.left, newPos.top,
newPos.right - newPos.left, newPos.bottom - newPos.top, swp );
if (cmd == SW_HIDE)
{
......@@ -1267,21 +1267,21 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
{
if (flags & PLACE_MIN)
{
SetWindowPos( hwnd, 0, wp.ptMinPosition.x, wp.ptMinPosition.y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
NtUserSetWindowPos( hwnd, 0, wp.ptMinPosition.x, wp.ptMinPosition.y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
}
}
else if( style & WS_MAXIMIZE )
{
if (flags & PLACE_MAX)
SetWindowPos( hwnd, 0, wp.ptMaxPosition.x, wp.ptMaxPosition.y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
NtUserSetWindowPos( hwnd, 0, wp.ptMaxPosition.x, wp.ptMaxPosition.y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
}
else if( flags & PLACE_RECT )
SetWindowPos( hwnd, 0, wp.rcNormalPosition.left, wp.rcNormalPosition.top,
wp.rcNormalPosition.right - wp.rcNormalPosition.left,
wp.rcNormalPosition.bottom - wp.rcNormalPosition.top,
SWP_NOZORDER | SWP_NOACTIVATE );
NtUserSetWindowPos( hwnd, 0, wp.rcNormalPosition.left, wp.rcNormalPosition.top,
wp.rcNormalPosition.right - wp.rcNormalPosition.left,
wp.rcNormalPosition.bottom - wp.rcNormalPosition.top,
SWP_NOZORDER | SWP_NOACTIVATE );
ShowWindow( hwnd, wndpl->showCmd );
......@@ -1451,39 +1451,6 @@ LONG WINPOS_HandleWindowPosChanging( HWND hwnd, WINDOWPOS *winpos )
/***********************************************************************
* dump_winpos_flags
*/
static void dump_winpos_flags(UINT flags)
{
static const DWORD dumped_flags = (SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW |
SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_SHOWWINDOW |
SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOOWNERZORDER |
SWP_NOSENDCHANGING | SWP_DEFERERASE | SWP_ASYNCWINDOWPOS |
SWP_NOCLIENTSIZE | SWP_NOCLIENTMOVE | SWP_STATECHANGED);
TRACE("flags:");
if(flags & SWP_NOSIZE) TRACE(" SWP_NOSIZE");
if(flags & SWP_NOMOVE) TRACE(" SWP_NOMOVE");
if(flags & SWP_NOZORDER) TRACE(" SWP_NOZORDER");
if(flags & SWP_NOREDRAW) TRACE(" SWP_NOREDRAW");
if(flags & SWP_NOACTIVATE) TRACE(" SWP_NOACTIVATE");
if(flags & SWP_FRAMECHANGED) TRACE(" SWP_FRAMECHANGED");
if(flags & SWP_SHOWWINDOW) TRACE(" SWP_SHOWWINDOW");
if(flags & SWP_HIDEWINDOW) TRACE(" SWP_HIDEWINDOW");
if(flags & SWP_NOCOPYBITS) TRACE(" SWP_NOCOPYBITS");
if(flags & SWP_NOOWNERZORDER) TRACE(" SWP_NOOWNERZORDER");
if(flags & SWP_NOSENDCHANGING) TRACE(" SWP_NOSENDCHANGING");
if(flags & SWP_DEFERERASE) TRACE(" SWP_DEFERERASE");
if(flags & SWP_ASYNCWINDOWPOS) TRACE(" SWP_ASYNCWINDOWPOS");
if(flags & SWP_NOCLIENTSIZE) TRACE(" SWP_NOCLIENTSIZE");
if(flags & SWP_NOCLIENTMOVE) TRACE(" SWP_NOCLIENTMOVE");
if(flags & SWP_STATECHANGED) TRACE(" SWP_STATECHANGED");
if(flags & ~dumped_flags) TRACE(" %08x", flags & ~dumped_flags);
TRACE("\n");
}
/***********************************************************************
* map_dpi_winpos
*/
static void map_dpi_winpos( WINDOWPOS *winpos )
......@@ -1699,8 +1666,8 @@ static HWND SWP_DoOwnedPopups(HWND hwnd, HWND hwndInsertAfter)
if (list[i] == hwnd) break;
if (GetWindow( list[i], GW_OWNER ) != hwnd) continue;
TRACE( "moving %p owned by %p after %p\n", list[i], hwnd, hwndInsertAfter );
SetWindowPos( list[i], hwndInsertAfter, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING | SWP_DEFERERASE );
NtUserSetWindowPos( list[i], hwndInsertAfter, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING | SWP_DEFERERASE );
hwndInsertAfter = list[i];
}
......@@ -2234,44 +2201,6 @@ done:
}
/***********************************************************************
* SetWindowPos (USER32.@)
*/
BOOL WINAPI SetWindowPos( HWND hwnd, HWND hwndInsertAfter,
INT x, INT y, INT cx, INT cy, UINT flags )
{
WINDOWPOS winpos;
TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
hwnd, hwndInsertAfter, x, y, cx, cy, flags);
if(TRACE_ON(win)) dump_winpos_flags(flags);
if (is_broadcast(hwnd))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
winpos.hwnd = WIN_GetFullHandle(hwnd);
winpos.hwndInsertAfter = WIN_GetFullHandle(hwndInsertAfter);
winpos.x = x;
winpos.y = y;
winpos.cx = cx;
winpos.cy = cy;
winpos.flags = flags;
map_dpi_winpos( &winpos );
if (WIN_IsCurrentThread( hwnd ))
return USER_SetWindowPos( &winpos, 0, 0 );
if (flags & SWP_ASYNCWINDOWPOS)
return SendNotifyMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
else
return SendMessageW( winpos.hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)&winpos );
}
/***********************************************************************
* BeginDeferWindowPos (USER32.@)
*/
HDWP WINAPI BeginDeferWindowPos( INT count )
......@@ -2460,8 +2389,8 @@ UINT WINAPI ArrangeIconicWindows( HWND parent )
{
if( IsIconic( hwndChild ) )
{
SetWindowPos( hwndChild, 0, pt.x, pt.y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
NtUserSetWindowPos( hwndChild, 0, pt.x, pt.y, 0, 0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
get_next_minimized_child_pos( &rectParent, &metrics, width, height, &pt );
count++;
}
......@@ -2796,9 +2725,9 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
{
RECT rect = sizingRect;
MapWindowPoints( 0, parent, (POINT *)&rect, 2 );
SetWindowPos( hwnd, 0, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
(hittest == HTCAPTION) ? SWP_NOSIZE : 0 );
NtUserSetWindowPos( hwnd, 0, rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
(hittest == HTCAPTION) ? SWP_NOSIZE : 0 );
}
}
}
......@@ -2829,18 +2758,18 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
{
/* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */
if (!DragFullWindows)
SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top,
sizingRect.right - sizingRect.left,
sizingRect.bottom - sizingRect.top,
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
NtUserSetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top,
sizingRect.right - sizingRect.left,
sizingRect.bottom - sizingRect.top,
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
}
else
{ /* restore previous size/position */
if(DragFullWindows)
SetWindowPos( hwnd, 0, origRect.left, origRect.top,
origRect.right - origRect.left,
origRect.bottom - origRect.top,
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
NtUserSetWindowPos( hwnd, 0, origRect.left, origRect.top,
origRect.right - origRect.left,
origRect.bottom - origRect.top,
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
}
}
......
......@@ -41,6 +41,9 @@ LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpar
{
switch(msg)
{
case WM_WINE_SETWINDOWPOS:
if (is_desktop_window( hwnd )) return 0;
return set_window_pos( (WINDOWPOS *)lparam, 0, 0 );
case WM_WINE_SETACTIVEWINDOW:
if (!wparam && NtUserGetForegroundWindow() == hwnd) return 0;
return (LRESULT)NtUserSetActiveWindow( (HWND)wparam );
......
......@@ -36,7 +36,6 @@ struct user_callbacks
LRESULT (WINAPI *pSendMessageTimeoutW)( HWND, UINT, WPARAM, LPARAM, UINT, UINT, PDWORD_PTR );
LRESULT (WINAPI *pSendMessageW)( HWND, UINT, WPARAM, LPARAM );
BOOL (WINAPI *pSendNotifyMessageW)( HWND, UINT, WPARAM, LPARAM );
BOOL (WINAPI *pSetWindowPos)( HWND, HWND, INT, INT, INT, INT, UINT );
BOOL (WINAPI *pShowCaret)( HWND hwnd );
DWORD (WINAPI *pWaitForInputIdle)( HANDLE, DWORD );
void (CDECL *notify_ime)( HWND hwnd, UINT param );
......@@ -113,6 +112,12 @@ typedef struct tagWND
#define WND_OTHER_PROCESS ((WND *)1) /* returned by WIN_GetPtr on unknown window handles */
#define WND_DESKTOP ((WND *)2) /* returned by WIN_GetPtr on the desktop window */
/* check if hwnd is a broadcast magic handle */
static inline BOOL is_broadcast( HWND hwnd )
{
return hwnd == HWND_BROADCAST || hwnd == HWND_TOPMOST;
}
WND *next_thread_window_ptr( HWND *hwnd );
#define WM_IME_INTERNAL 0x287
......
......@@ -329,6 +329,9 @@ extern void user_lock(void) DECLSPEC_HIDDEN;
extern void user_unlock(void) DECLSPEC_HIDDEN;
extern void user_check_not_lock(void) DECLSPEC_HIDDEN;
/* windc.c */
extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
/* window.c */
struct tagWND;
extern HWND get_desktop_window(void) DECLSPEC_HIDDEN;
......@@ -339,6 +342,7 @@ extern BOOL get_window_placement( HWND hwnd, WINDOWPLACEMENT *placement ) DECLSP
extern DWORD get_window_thread( HWND hwnd, DWORD *process ) DECLSPEC_HIDDEN;
extern HWND is_current_process_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern HWND is_current_thread_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL is_iconic( HWND hwnd ) DECLSPEC_HIDDEN;
extern DWORD get_window_long( HWND hwnd, INT offset ) DECLSPEC_HIDDEN;
extern BOOL get_window_rect( HWND hwnd, RECT *rect, UINT dpi ) DECLSPEC_HIDDEN;
......@@ -348,6 +352,7 @@ extern BOOL get_window_rects( HWND hwnd, enum coords_relative relative, RECT *wi
extern HWND *list_window_children( HDESK desktop, HWND hwnd, UNICODE_STRING *class,
DWORD tid ) DECLSPEC_HIDDEN;
extern void map_window_region( HWND from, HWND to, HRGN hrgn ) DECLSPEC_HIDDEN;
extern BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) DECLSPEC_HIDDEN;
extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN;
/* to release pointers retrieved by win_get_ptr */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment