{
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;
}
}
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?
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 )))
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;