mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 00:03:03 +00:00
[NtUser|User32]
- Start moving system control functions into Win32k. See CORE-7447. - Sync port from wine to update code before move and test. svn path=/trunk/; revision=62692
This commit is contained in:
parent
b7eda79879
commit
707b9ab918
4 changed files with 218 additions and 109 deletions
|
@ -134,6 +134,72 @@ DefWndControlColor(HDC hDC, UINT ctlType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LRESULT FASTCALL
|
||||||
|
DefWndHandleWindowPosChanging(PWND pWnd, WINDOWPOS* Pos)
|
||||||
|
{
|
||||||
|
POINT maxTrack, minTrack;
|
||||||
|
LONG style = pWnd->style;
|
||||||
|
|
||||||
|
if (Pos->flags & SWP_NOSIZE) return 0;
|
||||||
|
if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0))
|
||||||
|
{
|
||||||
|
co_WinPosGetMinMaxInfo(pWnd, NULL, NULL, &minTrack, &maxTrack);
|
||||||
|
Pos->cx = min(Pos->cx, maxTrack.x);
|
||||||
|
Pos->cy = min(Pos->cy, maxTrack.y);
|
||||||
|
if (!(style & WS_MINIMIZE))
|
||||||
|
{
|
||||||
|
if (Pos->cx < minTrack.x) Pos->cx = minTrack.x;
|
||||||
|
if (Pos->cy < minTrack.y) Pos->cy = minTrack.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Pos->cx = max(Pos->cx, 0);
|
||||||
|
Pos->cy = max(Pos->cy, 0);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
LRESULT FASTCALL
|
||||||
|
DefWndHandleWindowPosChanged(PWND pWnd, WINDOWPOS* Pos)
|
||||||
|
{
|
||||||
|
RECT Rect;
|
||||||
|
LONG style = pWnd->style;
|
||||||
|
|
||||||
|
IntGetClientRect(pWnd, &Rect);
|
||||||
|
IntMapWindowPoints(pWnd, (style & WS_CHILD ? IntGetParent(pWnd) : NULL), (LPPOINT) &Rect, 2);
|
||||||
|
|
||||||
|
if (! (Pos->flags & SWP_NOCLIENTMOVE))
|
||||||
|
{
|
||||||
|
co_IntSendMessage(UserHMGetHandle(pWnd), WM_MOVE, 0, MAKELONG(Rect.left, Rect.top));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! (Pos->flags & SWP_NOCLIENTSIZE))
|
||||||
|
{
|
||||||
|
WPARAM wp = SIZE_RESTORED;
|
||||||
|
|
||||||
|
if (style & WS_MAXIMIZE) wp = SIZE_MAXIMIZED;
|
||||||
|
else if (style & WS_MINIMIZE) wp = SIZE_MINIMIZED;
|
||||||
|
|
||||||
|
co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, wp, MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID FASTCALL
|
||||||
|
UserDrawWindowFrame(HDC hdc,
|
||||||
|
RECTL *rect,
|
||||||
|
ULONG width,
|
||||||
|
ULONG height)
|
||||||
|
{
|
||||||
|
HBRUSH hbrush = NtGdiSelectBrush( hdc, gpsi->hbrGray );
|
||||||
|
NtGdiPatBlt( hdc, rect->left, rect->top, rect->right - rect->left - width, height, PATINVERT );
|
||||||
|
NtGdiPatBlt( hdc, rect->left, rect->top + height, width, rect->bottom - rect->top - height, PATINVERT );
|
||||||
|
NtGdiPatBlt( hdc, rect->left + width, rect->bottom - 1, rect->right - rect->left - width, -height, PATINVERT );
|
||||||
|
NtGdiPatBlt( hdc, rect->right - 1, rect->top, -width, rect->bottom - rect->top - height, PATINVERT );
|
||||||
|
NtGdiSelectBrush( hdc, hbrush );
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT FASTCALL
|
LRESULT FASTCALL
|
||||||
DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam)
|
DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -264,6 +330,7 @@ IntDefWindowProc(
|
||||||
}
|
}
|
||||||
|
|
||||||
case WM_SETREDRAW:
|
case WM_SETREDRAW:
|
||||||
|
ERR("WM_SETREDRAW\n");
|
||||||
if (wParam)
|
if (wParam)
|
||||||
{
|
{
|
||||||
if (!(Wnd->style & WS_VISIBLE))
|
if (!(Wnd->style & WS_VISIBLE))
|
||||||
|
@ -282,6 +349,16 @@ IntDefWindowProc(
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case WM_WINDOWPOSCHANGING:
|
||||||
|
{
|
||||||
|
return (DefWndHandleWindowPosChanging(Wnd, (WINDOWPOS*)lParam));
|
||||||
|
}
|
||||||
|
|
||||||
|
case WM_WINDOWPOSCHANGED:
|
||||||
|
{
|
||||||
|
return (DefWndHandleWindowPosChanged(Wnd, (WINDOWPOS*)lParam));
|
||||||
|
}
|
||||||
|
|
||||||
/* ReactOS only. */
|
/* ReactOS only. */
|
||||||
case WM_CBT:
|
case WM_CBT:
|
||||||
{
|
{
|
||||||
|
|
|
@ -134,7 +134,7 @@ static MSGMEMORY g_MsgMemory[] =
|
||||||
{ WM_SETTINGCHANGE, MMS_SIZE_LPARAMSZ, MMS_FLAG_READ },
|
{ WM_SETTINGCHANGE, MMS_SIZE_LPARAMSZ, MMS_FLAG_READ },
|
||||||
{ WM_COPYDATA, MMS_SIZE_SPECIAL, MMS_FLAG_READ },
|
{ WM_COPYDATA, MMS_SIZE_SPECIAL, MMS_FLAG_READ },
|
||||||
{ WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ },
|
{ WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ },
|
||||||
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
|
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
||||||
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam);
|
||||||
BOOL FASTCALL IntIsWindow(HWND hWnd);
|
BOOL FASTCALL IntIsWindow(HWND hWnd);
|
||||||
HWND* FASTCALL IntWinListChildren(PWND Window);
|
HWND* FASTCALL IntWinListChildren(PWND Window);
|
||||||
VOID FASTCALL IntGetClientRect (PWND WindowObject, RECTL *Rect);
|
VOID FASTCALL IntGetClientRect (PWND WindowObject, RECTL *Rect);
|
||||||
|
INT FASTCALL IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints);
|
||||||
BOOL FASTCALL IntIsChildWindow (PWND Parent, PWND Child);
|
BOOL FASTCALL IntIsChildWindow (PWND Parent, PWND Child);
|
||||||
VOID FASTCALL IntUnlinkWindow(PWND Wnd);
|
VOID FASTCALL IntUnlinkWindow(PWND Wnd);
|
||||||
VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev);
|
VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev);
|
||||||
|
|
|
@ -153,7 +153,7 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 // Moved to Win32k
|
||||||
VOID
|
VOID
|
||||||
DefWndSetRedraw(HWND hWnd, WPARAM wParam)
|
DefWndSetRedraw(HWND hWnd, WPARAM wParam)
|
||||||
{
|
{
|
||||||
|
@ -177,7 +177,7 @@ DefWndSetRedraw(HWND hWnd, WPARAM wParam)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
LRESULT
|
LRESULT
|
||||||
DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam, ULONG Style)
|
DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam, ULONG Style)
|
||||||
|
@ -277,8 +277,11 @@ DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint)
|
||||||
rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
||||||
if (Style & WS_MAXIMIZEBOX)
|
if (Style & WS_MAXIMIZEBOX)
|
||||||
rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
|
||||||
pt.x = rectWindow.left + (rect.right - rect.left) / 2;
|
//pt.x = rectWindow.left + (rect.right - rect.left) / 2;
|
||||||
pt.y = rectWindow.top + rect.top + GetSystemMetrics(SM_CYSIZE)/2;
|
//pt.y = rectWindow.top + rect.top + GetSystemMetrics(SM_CYSIZE)/2;
|
||||||
|
pt.x = (rect.right + rect.left) / 2;
|
||||||
|
pt.y = rect.top + GetSystemMetrics(SM_CYSIZE)/2;
|
||||||
|
ERR("SC_MOVE\n");
|
||||||
hittest = HTCAPTION;
|
hittest = HTCAPTION;
|
||||||
*capturePoint = pt;
|
*capturePoint = pt;
|
||||||
}
|
}
|
||||||
|
@ -293,9 +296,12 @@ DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint)
|
||||||
switch(msg.message)
|
switch(msg.message)
|
||||||
{
|
{
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
|
//// Clamp the mouse position to the window rectangle when starting a window resize.
|
||||||
|
//pt.x = min( max( msg.pt.x, rectWindow.left ), rectWindow.right - 1 );
|
||||||
|
//pt.y = min( max( msg.pt.y, rectWindow.top ), rectWindow.bottom - 1 );
|
||||||
|
//// Breaks a win test.
|
||||||
hittest = DefWndNCHitTest(hWnd, msg.pt);
|
hittest = DefWndNCHitTest(hWnd, msg.pt);
|
||||||
if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT))
|
if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) hittest = 0;
|
||||||
hittest = 0;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
|
@ -354,19 +360,8 @@ static VOID
|
||||||
UserDrawWindowFrame(HDC hdc, const RECT *rect,
|
UserDrawWindowFrame(HDC hdc, const RECT *rect,
|
||||||
ULONG width, ULONG height)
|
ULONG width, ULONG height)
|
||||||
{
|
{
|
||||||
static HBRUSH hDraggingRectBrush = NULL;
|
HBRUSH hbrush = SelectObject( hdc, gpsi->hbrGray );
|
||||||
HBRUSH hbrush;
|
|
||||||
|
|
||||||
if(!hDraggingRectBrush)
|
|
||||||
{
|
|
||||||
static HBITMAP hDraggingPattern = NULL;
|
|
||||||
const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA};
|
|
||||||
|
|
||||||
hDraggingPattern = CreateBitmap(8, 8, 1, 1, Pattern);
|
|
||||||
hDraggingRectBrush = CreatePatternBrush(hDraggingPattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
hbrush = SelectObject( hdc, hDraggingRectBrush );
|
|
||||||
PatBlt( hdc, rect->left, rect->top,
|
PatBlt( hdc, rect->left, rect->top,
|
||||||
rect->right - rect->left - width, height, PATINVERT );
|
rect->right - rect->left - width, height, PATINVERT );
|
||||||
PatBlt( hdc, rect->left, rect->top + height, width,
|
PatBlt( hdc, rect->left, rect->top + height, width,
|
||||||
|
@ -410,6 +405,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
BOOL DragFullWindows = FALSE;
|
BOOL DragFullWindows = FALSE;
|
||||||
HWND hWndParent = NULL;
|
HWND hWndParent = NULL;
|
||||||
PWND Wnd;
|
PWND Wnd;
|
||||||
|
WPARAM syscommand = wParam & 0xfff0;
|
||||||
|
HMONITOR mon = 0;
|
||||||
|
|
||||||
Wnd = ValidateHwnd(hwnd);
|
Wnd = ValidateHwnd(hwnd);
|
||||||
if (!Wnd)
|
if (!Wnd)
|
||||||
|
@ -419,36 +416,32 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
ExStyle = Wnd->ExStyle;
|
ExStyle = Wnd->ExStyle;
|
||||||
iconic = (Style & WS_MINIMIZE) != 0;
|
iconic = (Style & WS_MINIMIZE) != 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Show window contents while dragging the window, get flag from registry data.
|
||||||
|
//
|
||||||
SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0);
|
SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0);
|
||||||
|
|
||||||
pt.x = GET_X_LPARAM(dwPoint);
|
pt.x = GET_X_LPARAM(dwPoint);
|
||||||
pt.y = GET_Y_LPARAM(dwPoint);
|
pt.y = GET_Y_LPARAM(dwPoint);
|
||||||
capturePoint = pt;
|
capturePoint = pt;
|
||||||
|
|
||||||
if ((Style & WS_MAXIMIZE) || !IsWindowVisible(hwnd))
|
TRACE("hwnd %p command %04lx, hittest %d, pos %d,%d\n",
|
||||||
{
|
hwnd, syscommand, hittest, pt.x, pt.y);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
thickframe = UserHasThickFrameStyle(Style, ExStyle) && !(Style & WS_MINIMIZE);
|
if ((Style & WS_MAXIMIZE) || !IsWindowVisible(hwnd)) return;
|
||||||
if ((wParam & 0xfff0) == SC_MOVE)
|
|
||||||
|
thickframe = UserHasThickFrameStyle(Style, ExStyle) && !iconic;
|
||||||
|
|
||||||
|
if (syscommand == SC_MOVE)
|
||||||
{
|
{
|
||||||
if (!hittest)
|
ERR("SC_MOVE\n");
|
||||||
{
|
if (!hittest) hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint);
|
||||||
hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint);
|
if (!hittest) return;
|
||||||
}
|
|
||||||
if (!hittest)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else /* SC_SIZE */
|
else /* SC_SIZE */
|
||||||
{
|
{
|
||||||
if (!thickframe)
|
if (!thickframe) return;
|
||||||
{
|
if (hittest && (syscommand != SC_MOUSEMENU))
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (hittest && ((wParam & 0xfff0) != SC_MOUSEMENU))
|
|
||||||
{
|
{
|
||||||
hittest += (HTLEFT - WMSZ_LEFT);
|
hittest += (HTLEFT - WMSZ_LEFT);
|
||||||
}
|
}
|
||||||
|
@ -468,6 +461,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
|
|
||||||
WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack);
|
WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack);
|
||||||
sizingRect = Wnd->rcWindow;
|
sizingRect = Wnd->rcWindow;
|
||||||
|
ERR("x %d y %d X %d Y %d\n",pt.x,pt.y,sizingRect.left,sizingRect.top);
|
||||||
if (Style & WS_CHILD)
|
if (Style & WS_CHILD)
|
||||||
{
|
{
|
||||||
hWndParent = GetParent(hwnd);
|
hWndParent = GetParent(hwnd);
|
||||||
|
@ -489,6 +483,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
SetRect(&mouseRect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
|
SetRect(&mouseRect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
|
||||||
clipRect = mouseRect;
|
clipRect = mouseRect;
|
||||||
}
|
}
|
||||||
|
mon = MonitorFromPoint( pt, MONITOR_DEFAULTTONEAREST );
|
||||||
unmodRect = sizingRect;
|
unmodRect = sizingRect;
|
||||||
}
|
}
|
||||||
ClipCursor(&clipRect);
|
ClipCursor(&clipRect);
|
||||||
|
@ -519,6 +514,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
MapWindowPoints( hWndParent, 0, (LPPOINT)&mouseRect, 2 );
|
MapWindowPoints( hWndParent, 0, (LPPOINT)&mouseRect, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IntNotifyWinEvent( EVENT_SYSTEM_MOVESIZESTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0);
|
||||||
SendMessageA( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
|
SendMessageA( hwnd, WM_ENTERSIZEMOVE, 0, 0 );
|
||||||
NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, hwnd);
|
NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, hwnd);
|
||||||
if (GetCapture() != hwnd) SetCapture( hwnd );
|
if (GetCapture() != hwnd) SetCapture( hwnd );
|
||||||
|
@ -589,9 +585,27 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
pt.x = max( pt.x, mouseRect.left );
|
pt.x = max( pt.x, mouseRect.left );
|
||||||
pt.x = min( pt.x, mouseRect.right );
|
pt.x = min( pt.x, mouseRect.right - 1 );
|
||||||
pt.y = max( pt.y, mouseRect.top );
|
pt.y = max( pt.y, mouseRect.top );
|
||||||
pt.y = min( pt.y, mouseRect.bottom );
|
pt.y = min( pt.y, mouseRect.bottom - 1 );
|
||||||
|
|
||||||
|
if (!hWndParent)
|
||||||
|
{
|
||||||
|
HMONITOR newmon;
|
||||||
|
MONITORINFO info;
|
||||||
|
|
||||||
|
if ((newmon = MonitorFromPoint( pt, MONITOR_DEFAULTTONULL )))
|
||||||
|
mon = newmon;
|
||||||
|
|
||||||
|
info.cbSize = sizeof(info);
|
||||||
|
if (mon && GetMonitorInfoW( mon, &info ))
|
||||||
|
{
|
||||||
|
pt.x = max( pt.x, info.rcWork.left );
|
||||||
|
pt.x = min( pt.x, info.rcWork.right - 1 );
|
||||||
|
pt.y = max( pt.y, info.rcWork.top );
|
||||||
|
pt.y = min( pt.y, info.rcWork.bottom - 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dx = pt.x - capturePoint.x;
|
dx = pt.x - capturePoint.x;
|
||||||
dy = pt.y - capturePoint.y;
|
dy = pt.y - capturePoint.y;
|
||||||
|
@ -613,7 +627,6 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RECT newRect = unmodRect;
|
RECT newRect = unmodRect;
|
||||||
WPARAM wpSizingHit = 0;
|
|
||||||
|
|
||||||
if (hittest == HTCAPTION) OffsetRect( &newRect, dx, dy );
|
if (hittest == HTCAPTION) OffsetRect( &newRect, dx, dy );
|
||||||
if (ON_LEFT_BORDER(hittest)) newRect.left += dx;
|
if (ON_LEFT_BORDER(hittest)) newRect.left += dx;
|
||||||
|
@ -624,18 +637,26 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
capturePoint = pt;
|
capturePoint = pt;
|
||||||
|
|
||||||
/* determine the hit location */
|
/* determine the hit location */
|
||||||
|
unmodRect = newRect;
|
||||||
|
if (syscommand == SC_SIZE)
|
||||||
|
{
|
||||||
|
WPARAM wpSizingHit = 0;
|
||||||
|
|
||||||
if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT)
|
if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT)
|
||||||
wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT);
|
wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT);
|
||||||
unmodRect = newRect;
|
SendMessageW( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&newRect );
|
||||||
SendMessageA( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&newRect );
|
}
|
||||||
|
else
|
||||||
|
SendMessageW( hwnd, WM_MOVING, 0, (LPARAM)&newRect );
|
||||||
|
|
||||||
if (!iconic)
|
if (!iconic)
|
||||||
{
|
{
|
||||||
if(!DragFullWindows)
|
if(!DragFullWindows)
|
||||||
UserDrawMovingFrame( hdc, &newRect, thickframe );
|
UserDrawMovingFrame( hdc, &newRect, thickframe );
|
||||||
else {
|
else
|
||||||
/* To avoid any deadlocks, all the locks on the windows
|
{ /* To avoid any deadlocks, all the locks on the windows
|
||||||
structures must be suspended before the SetWindowPos */
|
structures must be suspended before the SetWindowPos */
|
||||||
|
//ERR("SWP 1\n");
|
||||||
SetWindowPos( hwnd, 0, newRect.left, newRect.top,
|
SetWindowPos( hwnd, 0, newRect.left, newRect.top,
|
||||||
newRect.right - newRect.left,
|
newRect.right - newRect.left,
|
||||||
newRect.bottom - newRect.top,
|
newRect.bottom - newRect.top,
|
||||||
|
@ -671,6 +692,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
DeleteObject(DesktopRgn);
|
DeleteObject(DesktopRgn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//// This causes the mdi child window to jump up when it is moved.
|
||||||
|
//if (hWndParent) MapWindowPoints( 0, hWndParent, (POINT *)&sizingRect, 2 );
|
||||||
|
|
||||||
if (ISITHOOKED(WH_CBT))
|
if (ISITHOOKED(WH_CBT))
|
||||||
{
|
{
|
||||||
|
@ -692,31 +715,36 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam)
|
||||||
if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) )
|
if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) )
|
||||||
{
|
{
|
||||||
/* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */
|
/* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */
|
||||||
if(!DragFullWindows)
|
if(!DragFullWindows )//|| iconic) breaks 2 win tests.
|
||||||
|
{
|
||||||
|
//ERR("SWP 2\n");
|
||||||
SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top,
|
SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top,
|
||||||
sizingRect.right - sizingRect.left,
|
sizingRect.right - sizingRect.left,
|
||||||
sizingRect.bottom - sizingRect.top,
|
sizingRect.bottom - sizingRect.top,
|
||||||
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
|
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
|
||||||
}
|
}
|
||||||
else { /* restore previous size/position */
|
}
|
||||||
|
else
|
||||||
|
{ /* restore previous size/position */
|
||||||
if(DragFullWindows)
|
if(DragFullWindows)
|
||||||
|
{
|
||||||
|
//ERR("SWP 3\n");
|
||||||
SetWindowPos( hwnd, 0, origRect.left, origRect.top,
|
SetWindowPos( hwnd, 0, origRect.left, origRect.top,
|
||||||
origRect.right - origRect.left,
|
origRect.right - origRect.left,
|
||||||
origRect.bottom - origRect.top,
|
origRect.bottom - origRect.top,
|
||||||
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
|
( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( IsWindow(hwnd) )
|
if( IsWindow(hwnd) )
|
||||||
if( Style & WS_MINIMIZE )
|
if( iconic )
|
||||||
{
|
{
|
||||||
/* Single click brings up the system menu when iconized */
|
/* Single click brings up the system menu when iconized */
|
||||||
|
|
||||||
if( !moved )
|
if( !moved )
|
||||||
{
|
{
|
||||||
if( Style & WS_SYSMENU )
|
if( Style & WS_SYSMENU )
|
||||||
SendMessageA( hwnd, WM_SYSCOMMAND,
|
SendMessageA( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y));
|
||||||
SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -858,7 +886,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
#if 0 // Move to Win32k
|
||||||
LRESULT
|
LRESULT
|
||||||
DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos)
|
DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos)
|
||||||
{
|
{
|
||||||
|
@ -916,6 +944,7 @@ DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DefWndControlColor
|
* DefWndControlColor
|
||||||
|
@ -1165,7 +1194,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
{
|
{
|
||||||
return (DefWndNCLButtonDblClk(hWnd, wParam, lParam));
|
return (DefWndNCLButtonDblClk(hWnd, wParam, lParam));
|
||||||
}
|
}
|
||||||
|
/* Moved to Win32k
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
{
|
{
|
||||||
return (DefWndHandleWindowPosChanging(hWnd, (WINDOWPOS*)lParam));
|
return (DefWndHandleWindowPosChanging(hWnd, (WINDOWPOS*)lParam));
|
||||||
|
@ -1175,7 +1204,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
{
|
{
|
||||||
return (DefWndHandleWindowPosChanged(hWnd, (WINDOWPOS*)lParam));
|
return (DefWndHandleWindowPosChanged(hWnd, (WINDOWPOS*)lParam));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
case WM_NCRBUTTONDOWN:
|
case WM_NCRBUTTONDOWN:
|
||||||
return NC_HandleNCRButtonDown( hWnd, wParam, lParam );
|
return NC_HandleNCRButtonDown( hWnd, wParam, lParam );
|
||||||
|
|
||||||
|
@ -1314,7 +1343,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
/*
|
/* Moved to Win32k
|
||||||
case WM_SYNCPAINT:
|
case WM_SYNCPAINT:
|
||||||
{
|
{
|
||||||
HRGN hRgn;
|
HRGN hRgn;
|
||||||
|
@ -1845,7 +1874,7 @@ User32DefWindowProc(HWND hWnd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move to win32k !*/
|
/* Move to Win32k !*/
|
||||||
case WM_SHOWWINDOW:
|
case WM_SHOWWINDOW:
|
||||||
if (!lParam) break; // Call when it is necessary.
|
if (!lParam) break; // Call when it is necessary.
|
||||||
case WM_SYNCPAINT:
|
case WM_SYNCPAINT:
|
||||||
|
@ -1853,6 +1882,8 @@ User32DefWindowProc(HWND hWnd,
|
||||||
case WM_CLIENTSHUTDOWN:
|
case WM_CLIENTSHUTDOWN:
|
||||||
case WM_GETHOTKEY:
|
case WM_GETHOTKEY:
|
||||||
case WM_SETHOTKEY:
|
case WM_SETHOTKEY:
|
||||||
|
case WM_WINDOWPOSCHANGING:
|
||||||
|
case WM_WINDOWPOSCHANGED:
|
||||||
{
|
{
|
||||||
LRESULT lResult;
|
LRESULT lResult;
|
||||||
NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode);
|
NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue