user32: Add helper for setting WS_EX_WINDOWEDGE flag.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-10-07 16:33:55 +02:00 committed by Alexandre Julliard
parent 3979f4a4e4
commit 94c1a67f78
1 changed files with 16 additions and 14 deletions

View File

@ -1461,6 +1461,20 @@ static void map_dpi_create_struct( CREATESTRUCTW *cs, UINT dpi_from, UINT dpi_to
cs->cy = MulDiv( cs->cy, dpi_to, dpi_from );
}
/***********************************************************************
* fix_exstyle
*/
static DWORD fix_exstyle( DWORD style, DWORD exstyle )
{
if ((exstyle & WS_EX_DLGMODALFRAME) ||
(!(exstyle & WS_EX_STATICEDGE) &&
(style & (WS_DLGFRAME | WS_THICKFRAME))))
exstyle |= WS_EX_WINDOWEDGE;
else
exstyle &= ~WS_EX_WINDOWEDGE;
return exstyle;
}
/***********************************************************************
* WIN_CreateWindowEx
*
@ -1596,13 +1610,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
}
WIN_FixCoordinates(cs, &sw); /* fix default coordinates */
if ((cs->dwExStyle & WS_EX_DLGMODALFRAME) ||
((!(cs->dwExStyle & WS_EX_STATICEDGE)) &&
(cs->style & (WS_DLGFRAME | WS_THICKFRAME))))
cs->dwExStyle |= WS_EX_WINDOWEDGE;
else
cs->dwExStyle &= ~WS_EX_WINDOWEDGE;
cs->dwExStyle = fix_exstyle(cs->style, cs->dwExStyle);
/* Create the window structure */
@ -2622,13 +2630,7 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return 0;
/* WS_EX_TOPMOST can only be changed through SetWindowPos */
newval = (style.styleNew & ~WS_EX_TOPMOST) | (wndPtr->dwExStyle & WS_EX_TOPMOST);
/* WS_EX_WINDOWEDGE depends on some other styles */
if (newval & WS_EX_DLGMODALFRAME)
newval |= WS_EX_WINDOWEDGE;
else if (!(newval & WS_EX_STATICEDGE) && (wndPtr->dwStyle & (WS_DLGFRAME | WS_THICKFRAME)))
newval |= WS_EX_WINDOWEDGE;
else
newval &= ~WS_EX_WINDOWEDGE;
newval = fix_exstyle(wndPtr->dwStyle, newval);
break;
case GWLP_HWNDPARENT:
if (wndPtr->parent == GetDesktopWindow())