((exStyle) & WS_EX_DLGMODALFRAME) || \
!((style) & (WS_CHILD | WS_POPUP)))
-#define HAS_MENU(w) (!((w)->dwStyle & WS_CHILD) && ((w)->wIDmenu != 0))
+#define HAS_MENU(w) ((((w)->dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD) && ((w)->wIDmenu != 0))
/******************************************************************************
winRect->right -= tmpRect.right;
winRect->bottom -= tmpRect.bottom;
- if (!(style & WS_CHILD) && GetMenu(hwnd))
+ if (((style & (WS_CHILD | WS_POPUP)) != WS_CHILD) && GetMenu(hwnd))
{
TRACE("Calling GetMenuBarHeight with hwnd %p, width %ld, at (%ld, %ld).\n",
hwnd, winRect->right - winRect->left, -tmpRect.left, -tmpRect.top );
style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
GetClientRect(GetAncestor(hwnd,GA_PARENT), &rc);
- AdjustWindowRectEx(&rc, style, 0, exstyle);
+ AdjustWindowRectEx(&rc, style, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
/* avoid calculating this twice */
style &= ~(WS_DLGFRAME | WS_BORDER | WS_THICKFRAME);