case VK_ESCAPE:
return 0;
}
+ break;
default:
IntTranslateKbdMessage( &msg, 0 );
pti->TIF_flags |= TIF_MOVESIZETRACKING;
PCURICON_OBJECT pIcon = NULL;
HICON hIcon;
- //FIXME: Some callers use this function as if it returns a boolean saying "this window has an icon".
- //FIXME: Hence we must return a pointer with no reference count.
- //FIXME: This is bad and we should feel bad.
- //FIXME: Stop whining over wine code.
-
hIcon = UserGetProp(pWnd, gpsi->atomIconSmProp, TRUE);
if (!hIcon) hIcon = UserGetProp(pWnd, gpsi->atomIconProp, TRUE);
}
if (hIcon)
{
- pIcon = UserGetCurIconObject(hIcon);
- if (pIcon)
- {
- UserDereferenceObject(pIcon);
- }
+ pIcon = (PCURICON_OBJECT)UserGetObjectNoErr(gHandleTable,
+ hIcon,
+ TYPE_CURSOR);
}
return pIcon;
}
return !(sbi.rgstate[0] & STATE_SYSTEM_OFFSCREEN);
}
-BOOL
-UserHasMenu(PWND pWnd, ULONG Style)
-{
- return (!(Style & WS_CHILD) && UlongToHandle(pWnd->IDMenu) != 0);
-}
-
/*
* FIXME:
* - Cache bitmaps, then just bitblt instead of calling DFC() (and
* wasting precious CPU cycles) every time
- * - Center the buttons verticaly in the rect
+ * - Center the buttons vertically in the rect
*/
VOID
UserDrawCaptionButton(PWND pWnd, LPRECT Rect, DWORD Style, DWORD ExStyle, HDC hDC, BOOL bDown, ULONG Type)
PMENU pSysMenu = IntGetSystemMenu(pWnd, FALSE);
UINT MenuState = IntGetMenuState(UserHMGetHandle(pSysMenu), SC_CLOSE, MF_BYCOMMAND); /* in case of error MenuState==0xFFFFFFFF */
- /* FIXME: A tool window has a smaller Close button */
-
+ /* A tool window has a smaller Close button */
if (ExStyle & WS_EX_TOOLWINDOW)
{
TempRect.left = TempRect.right - UserGetSystemMetrics(SM_CXSMSIZE);
if (!(Flags & DC_NOVISIBLE) && !IntIsWindowVisible(pWnd)) return;
- ERR("UserDrawCaptionBar: pWnd %p, hDc %p, Flags 0x%x.\n", pWnd, hDC, Flags);
+ TRACE("UserDrawCaptionBar: pWnd %p, hDc %p, Flags 0x%x.\n", pWnd, hDC, Flags);
Style = pWnd->style;
ExStyle = pWnd->ExStyle;
if (!(Style & WS_MINIMIZE))
{
- PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu));
/* Draw menu bar */
- if (menu && !(Style & WS_CHILD))
+ if (pWnd->state & WNDS_HASMENU && pWnd->IDMenu) // Should be pWnd->spmenu
{
+ PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); // FIXME!
TempRect = CurrentRect;
- TempRect.bottom = TempRect.top + menu->cyMenu;
+ TempRect.bottom = TempRect.top + menu->cyMenu; // Should be pWnd->spmenu->cyMenu;
CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE);
}
if (!(Style & WS_MINIMIZE))
{
- PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu));
/* Draw menu bar */
- if (menu && !(Style & WS_CHILD))
+ if (pWnd->state & WNDS_HASMENU && pWnd->IDMenu) // Should be pWnd->spmenu
{
- TempRect = CurrentRect;
- TempRect.bottom = TempRect.top + menu->cyMenu;
- if (!(Flags & DC_NOSENDMSG)) CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE);
+ if (!(Flags & DC_NOSENDMSG))
+ {
+ PMENU menu = UserGetMenuObject(UlongToHandle(pWnd->IDMenu)); // FIXME!
+ TempRect = CurrentRect;
+ TempRect.bottom = TempRect.top + menu->cyMenu; // Should be pWnd->spmenu->cyMenu;
+ CurrentRect.top += MENU_DrawMenuBar(hDC, &TempRect, pWnd, FALSE);
+ }
}
if (ExStyle & WS_EX_CLIENTEDGE)
Rect->top += UserGetSystemMetrics(SM_CYCAPTION);
}
- if (Wnd->IDMenu && ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD))
+ if (HAS_MENU(Wnd, Style))
{
HDC hDC = UserGetDCEx(Wnd, 0, DCX_USESTYLE | DCX_WINDOW);
}
if ((Wnd->state & WNDS_NONCPAINT) || !(Wnd->style & WS_VISIBLE))
- return 0;
+ return TRUE;
/* This isn't documented but is reproducible in at least XP SP2 and
* Outlook 2007 depends on it
RECTL_vInflateRect(&rcWindow, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME));
else if (HAS_THINFRAME( Style, ExStyle ))
RECTL_vInflateRect(&rcWindow, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER));
+ else if (HAS_CLIENTFRAME( Style, ExStyle ))
+ RECTL_vInflateRect(&rcWindow, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE));
if (!RECTL_bPointInRect( &rcWindow, pt.x, pt.y )) return HTBORDER;
}