user32: Don't allow changing the WS_EX_TOPMOST style with SetWindowLong.

This commit is contained in:
Alexandre Julliard 2007-10-31 17:53:58 +01:00
parent 917f288f1b
commit ebc6864953
2 changed files with 5 additions and 6 deletions

View File

@ -993,12 +993,9 @@ static void test_shell_window(void)
/* passes on Win XP, but not on Win98
ok(!ret, "third call to SetShellWindow(hwnd1)\n"); */
todo_wine
{
SetWindowLong(hwnd1, GWL_EXSTYLE, GetWindowLong(hwnd1,GWL_EXSTYLE)|WS_EX_TOPMOST);
ret = GetWindowLong(hwnd1,GWL_EXSTYLE)&WS_EX_TOPMOST? TRUE: FALSE;
ok(!ret, "SetWindowExStyle(hwnd1, WS_EX_TOPMOST)\n");
}
SetWindowLong(hwnd1, GWL_EXSTYLE, GetWindowLong(hwnd1,GWL_EXSTYLE)|WS_EX_TOPMOST);
ret = GetWindowLong(hwnd1,GWL_EXSTYLE)&WS_EX_TOPMOST? TRUE: FALSE;
ok(!ret, "SetWindowExStyle(hwnd1, WS_EX_TOPMOST)\n");
ret = DestroyWindow(hwnd1);
ok(ret, "DestroyWindow(hwnd1)\n");

View File

@ -1945,6 +1945,8 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
break;
case GWL_EXSTYLE:
req->flags = SET_WIN_EXSTYLE;
/* WS_EX_TOPMOST can only be changed through SetWindowPos */
newval = (newval & ~WS_EX_TOPMOST) | (wndPtr->dwExStyle & WS_EX_TOPMOST);
req->ex_style = newval;
break;
case GWLP_ID: