Add a test case and a fix for the window styles state at the window

creation time.
This commit is contained in:
Dmitry Timoshkov 2004-02-06 05:18:56 +00:00 committed by Alexandre Julliard
parent d18c8ca78f
commit 9b24af8acb
2 changed files with 19 additions and 13 deletions

View File

@ -556,10 +556,17 @@ static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
{
case HCBT_CREATEWND:
{
DWORD style;
CBT_CREATEWNDA *createwnd = (CBT_CREATEWNDA *)lParam;
trace("HCBT_CREATEWND: hwnd %p, parent %p, style %08lx\n",
(HWND)wParam, createwnd->lpcs->hwndParent, createwnd->lpcs->style);
ok(createwnd->hwndInsertAfter == HWND_TOP, "hwndInsertAfter should be always HWND_TOP\n");
/* WS_VISIBLE should be turned off yet */
style = createwnd->lpcs->style & ~WS_VISIBLE;
ok(style == GetWindowLongA((HWND)wParam, GWL_STYLE),
"style of hwnd and style in the CREATESTRUCT do not match: %08lx != %08lx\n",
GetWindowLongA((HWND)wParam, GWL_STYLE), style);
break;
}
}

View File

@ -1105,10 +1105,10 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
WIN_FixCoordinates(cs, &sw); /* fix default coordinates */
/* Correct the window style - stage 1
/* Correct the window styles.
*
* These are patches that appear to affect both the style loaded into the
* WIN structure and passed in the CreateStruct to the WM_CREATE etc.
* It affects both the style loaded into the WIN structure and
* passed in the CREATESTRUCT to the WM_[NC]CREATE.
*
* WS_EX_WINDOWEDGE appears to be enforced based on the other styles, so
* why does the user get to set it?
@ -1124,6 +1124,13 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
else
cs->dwExStyle &= ~WS_EX_WINDOWEDGE;
if (!(cs->style & WS_CHILD))
{
cs->style |= WS_CLIPSIBLINGS;
if (!(cs->style & WS_POPUP))
cs->style |= WS_CAPTION;
}
/* Create the window structure */
if (!(wndPtr = create_window_handle( parent, owner, classAtom, cs->hInstance, type )))
@ -1154,17 +1161,9 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
wndPtr->hIconSmall = 0;
wndPtr->hSysMenu = (wndPtr->dwStyle & WS_SYSMENU) ? MENU_GetSysMenu( hwnd, 0 ) : 0;
/* Correct the window style - stage 2 */
if (!(cs->style & (WS_CHILD | WS_POPUP)))
wndPtr->flags |= WIN_NEED_SIZE;
if (!(cs->style & WS_CHILD))
{
wndPtr->dwStyle |= WS_CLIPSIBLINGS;
if (!(cs->style & WS_POPUP))
{
wndPtr->dwStyle |= WS_CAPTION;
wndPtr->flags |= WIN_NEED_SIZE;
}
}
SERVER_START_REQ( set_window_info )
{
req->handle = hwnd;