user32: Prevent resetting WS_MINIMIZE through SetWindowLong.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Józef Kucia 2016-08-17 13:56:09 +02:00 committed by Alexandre Julliard
parent 412b8dcafb
commit 4277b055de
2 changed files with 4 additions and 7 deletions

View File

@ -6281,7 +6281,6 @@ static LRESULT WINAPI check_style_wnd_proc(HWND hwnd, UINT message, WPARAM wPara
{
ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n",
expected[1].styleOld, got->styleOld);
todo_wine_if(expected[0].styleOld & WS_MINIMIZE)
ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n",
expected[1].styleNew, got->styleNew);
}
@ -6330,13 +6329,9 @@ static void test_set_window_style(void)
for (i = 0; i < sizeof(tests) / sizeof(*tests); i++)
{
BOOL todo = FALSE;
expected_style = tests[i].style;
if ((tests[i].creation_style & WS_MINIMIZE) && !(tests[i].style & WS_MINIMIZE))
{
todo = TRUE;
if (tests[i].creation_style & WS_MINIMIZE)
expected_style |= WS_MINIMIZE;
}
expected_stylestruct[0].styleOld = tests[i].creation_style;
expected_stylestruct[0].styleNew = tests[i].style;
@ -6352,7 +6347,7 @@ static void test_set_window_style(void)
ok(old_style == tests[i].creation_style, "expected old style %#x, got %#x\n",
tests[i].creation_style, old_style);
new_style = GetWindowLongA(hwnd, GWL_STYLE);
todo_wine_if(todo) ok(new_style == expected_style, "expected new style %#x, got %#x\n",
ok(new_style == expected_style, "expected new style %#x, got %#x\n",
expected_style, new_style);
SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0);

View File

@ -2367,6 +2367,8 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
newval = style.styleNew;
/* WS_CLIPSIBLINGS can't be reset on top-level windows */
if (wndPtr->parent == GetDesktopWindow()) newval |= WS_CLIPSIBLINGS;
/* WS_MINIMIZE can't be reset */
if (wndPtr->dwStyle & WS_MINIMIZE) newval |= WS_MINIMIZE;
/* FIXME: changing WS_DLGFRAME | WS_THICKFRAME is supposed to change
WS_EX_WINDOWEDGE too */
break;