diff --git a/win32ss/user/ntuser/defwnd.c b/win32ss/user/ntuser/defwnd.c index fc55c4acfb..4e287bfc80 100644 --- a/win32ss/user/ntuser/defwnd.c +++ b/win32ss/user/ntuser/defwnd.c @@ -539,6 +539,9 @@ IntDefWindowProc( PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); LRESULT lResult = 0; USER_REFERENCE_ENTRY Ref; + BOOL IsTaskBar; + DWORD Style; + DWORD ExStyle; if (Msg > WM_USER) return 0; @@ -785,7 +788,22 @@ IntDefWindowProc( { HWND hwndTop = UserGetForegroundWindow(); PWND topWnd = UserGetWindowObject(hwndTop); - if (topWnd) + + /* Test for typical TaskBar ExStyle Values */ + ExStyle = (topWnd->ExStyle & (WS_EX_TOOLWINDOW | WS_EX_TOPMOST)); + TRACE("ExStyle is '%x'.\n", ExStyle); + + /* Test for typical TaskBar Style Values */ + Style = (topWnd->style & (WS_POPUP | WS_VISIBLE | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN)); + TRACE("Style is '%x'.\n", Style); + + /* Test for masked typical TaskBar Style and ExStyles to detect TaskBar */ + IsTaskBar = (Style == (WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN)) + && (ExStyle == (WS_EX_TOOLWINDOW | WS_EX_TOPMOST)); + TRACE("This %s the TaskBar.\n", IsTaskBar ? "is" : "is not"); + + if (topWnd && !IsTaskBar) /* Second test is so we are not touching the Taskbar */ { if ((topWnd->style & WS_THICKFRAME) == 0) { diff --git a/win32ss/user/ntuser/nonclient.c b/win32ss/user/ntuser/nonclient.c index ba8dececb1..2d04eb1874 100644 --- a/win32ss/user/ntuser/nonclient.c +++ b/win32ss/user/ntuser/nonclient.c @@ -256,6 +256,8 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam) //PMONITOR mon = 0; Don't port sync from wine!!! This breaks explorer task bar sizing!! // The task bar can grow in size and can not reduce due to the change // in the work area. + DWORD ExStyleTB, StyleTB; + BOOL IsTaskBar; Style = pwnd->style; ExStyle = pwnd->ExStyle; @@ -394,6 +396,21 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam) /* Exit on button-up */ if (msg.message == WM_LBUTTONUP) { + + /* Test for typical TaskBar ExStyle Values */ + ExStyleTB = (ExStyle & (WS_EX_TOOLWINDOW | WS_EX_TOPMOST)); + TRACE("ExStyle is '%x'.\n", ExStyleTB); + + /* Test for typical TaskBar Style Values */ + StyleTB = (Style & (WS_POPUP | WS_VISIBLE | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN)); + TRACE("Style is '%x'.\n", StyleTB); + + /* Test for masked typical TaskBar Style and ExStyles to detect TaskBar */ + IsTaskBar = (StyleTB == (WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN)) + && (ExStyleTB == (WS_EX_TOOLWINDOW | WS_EX_TOPMOST)); + TRACE("This %s the TaskBar.\n", IsTaskBar ? "is" : "is not"); + // check for snapping if was moved by caption if (hittest == HTCAPTION && thickframe && (ExStyle & WS_EX_MDICHILD) == 0) { @@ -401,6 +418,11 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam) BOOL doSideSnap = FALSE; UserSystemParametersInfo(SPI_GETWORKAREA, 0, &snapRect, 0); + /* if this is the taskbar, then we want to just exit */ + if (IsTaskBar) + { + break; + } // snap to left if (pt.x <= snapRect.left) {