{
case DFCS_CAPTIONMIN:
{
- if ((ExStyle & WS_EX_TOOLWINDOW) == TRUE)
+ if (ExStyle & WS_EX_TOOLWINDOW)
return; /* ToolWindows don't have min/max buttons */
if (Style & WS_SYSMENU)
}
case DFCS_CAPTIONMAX:
{
- if ((ExStyle & WS_EX_TOOLWINDOW) == TRUE)
+ if (ExStyle & WS_EX_TOOLWINDOW)
return; /* ToolWindows don't have min/max buttons */
if (Style & WS_SYSMENU)
{
/* FIXME: A tool window has a smaller Close button */
- TempRect.left = TempRect.right - GetSystemMetrics(SM_CXSIZE);
- TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYSIZE) - 2;
+ if (ExStyle & WS_EX_TOOLWINDOW)
+ {
+ TempRect.left = TempRect.right - GetSystemMetrics(SM_CXSMSIZE);
+ TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYSMSIZE) - 2;
+ }
+ else
+ {
+ TempRect.left = TempRect.right - GetSystemMetrics(SM_CXSIZE);
+ TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYSIZE) - 2;
+ }
TempRect.top += 2;
TempRect.right -= 2;
WindowRect.top += GetSystemMetrics(SM_CYCAPTION);
if (!PtInRect(&WindowRect, Point))
{
- if ((Style & WS_SYSMENU) && !(ExStyle & WS_EX_TOOLWINDOW))
+ if (Style & WS_SYSMENU)
{
- WindowRect.left += GetSystemMetrics(SM_CXSIZE);
- WindowRect.right -= GetSystemMetrics(SM_CXSIZE);
+ if (ExStyle & WS_EX_TOOLWINDOW)
+ {
+ WindowRect.right -= GetSystemMetrics(SM_CXSMSIZE);
+ }
+ else
+ {
+ WindowRect.left += GetSystemMetrics(SM_CXSIZE);
+ WindowRect.right -= GetSystemMetrics(SM_CXSIZE);
+ }
}
if (Point.x <= WindowRect.left)
return HTSYSMENU;
r.top = Padding;
r.bottom = r.top + (Height / 2);
- if ((uFlags & DC_ICON) && (Style & WS_SYSMENU))
+ if ((uFlags & DC_ICON) && (Style & WS_SYSMENU) && !(uFlags & DC_SMALLCAP))
{
// For some reason the icon isn't centered correctly...
r.top --;
if ((uFlags & DC_TEXT) && (GetWindowTextW( hWnd, buffer, sizeof(buffer)/sizeof(buffer[0]) )))
{
- // Duplicate odd behaviour from Windows:
- if ((! uFlags & DC_SMALLCAP) || (uFlags & DC_ICON) || (uFlags & DC_INBUTTON) ||
- (! uFlags & DC_ACTIVE))
+ if (!(uFlags & DC_SMALLCAP) && ((uFlags & DC_ICON) || (uFlags & DC_INBUTTON)))
r.left += GetSystemMetrics(SM_CXSIZE) + Padding;
r.right = (lprc->right - lprc->left);
- ButtonWidth = GetSystemMetrics(SM_CXSIZE) - 2;
+ if (uFlags & DC_SMALLCAP)
+ ButtonWidth = GetSystemMetrics(SM_CXSMSIZE) - 2;
+ else
+ ButtonWidth = GetSystemMetrics(SM_CXSIZE) - 2;
if (Style & WS_SYSMENU)
{