Windows now show captions

svn path=/trunk/; revision=3526
This commit is contained in:
Jason Filby 2002-09-20 21:55:50 +00:00
parent 088dbb0953
commit 2f3e32bfea
2 changed files with 29 additions and 3 deletions

View file

@ -1,4 +1,4 @@
/* $Id: desktop.c,v 1.7 2002/09/17 23:46:23 dwelch Exp $
/* $Id: desktop.c,v 1.8 2002/09/20 21:55:50 jfilby Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -33,6 +33,13 @@ SystemParametersInfoW(UINT uiAction,
PVOID pvParam,
UINT fWinIni)
{
NONCLIENTMETRICS *nclm;
/* FIXME: This should be obtained from the registry */
static LOGFONT CaptionFont =
{ 12, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, OEM_CHARSET,
0, 0, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, L"Timmons" };
switch (uiAction)
{
case SPI_GETWORKAREA:
@ -43,6 +50,13 @@ SystemParametersInfoW(UINT uiAction,
((PRECT)pvParam)->bottom = 480;
return(TRUE);
}
case SPI_GETNONCLIENTMETRICS:
{
nclm = pvParam;
memcpy(&nclm->lfCaptionFont, &CaptionFont, sizeof(LOGFONT));
memcpy(&nclm->lfSmCaptionFont, &CaptionFont, sizeof(LOGFONT));
return(TRUE);
}
}
return(FALSE);
}

View file

@ -1,4 +1,4 @@
/* $Id: defwnd.c,v 1.10 2002/09/17 23:46:23 dwelch Exp $
/* $Id: defwnd.c,v 1.11 2002/09/20 21:55:15 jfilby Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
@ -317,12 +317,24 @@ static void UserDrawCaptionNC( HDC hdc, RECT *rect, HWND hwnd,
if (GetWindowTextA( hwnd, buffer, sizeof(buffer) ))
{
NONCLIENTMETRICS nclm;
HFONT hFont, hOldFont;
nclm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
if (style & WS_EX_TOOLWINDOW)
hFont = CreateFontIndirectW(&nclm.lfSmCaptionFont);
else
hFont = CreateFontIndirectW(&nclm.lfCaptionFont);
hOldFont = SelectObject(hdc, hFont);
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
SetBkMode( hdc, TRANSPARENT );
/*DrawTextA( hdc, buffer, -1, &r,
DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_NOPREFIX );*/
TextOutA(hdc, r.left, r.top, buffer, strlen(buffer));
TextOutA(hdc, r.left+5, r.top+2, buffer, strlen(buffer));
DeleteObject (SelectObject (hdc, hOldFont));
}
}