Print the Window caption using Unicode calls.
Don't send WM_GETTEXT to retrieve the caption text.
This commit is contained in:
parent
dff5004bc0
commit
b72994b6d4
|
@ -865,7 +865,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style,
|
||||||
DWORD exStyle, BOOL active )
|
DWORD exStyle, BOOL active )
|
||||||
{
|
{
|
||||||
RECT r = *rect;
|
RECT r = *rect;
|
||||||
char buffer[256];
|
WCHAR buffer[256];
|
||||||
HPEN hPrevPen;
|
HPEN hPrevPen;
|
||||||
HMENU hSysMenu;
|
HMENU hSysMenu;
|
||||||
|
|
||||||
|
@ -912,21 +912,22 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetWindowTextA( hwnd, buffer, sizeof(buffer) )) {
|
if (InternalGetWindowText( hwnd, buffer, sizeof(buffer)/sizeof(WCHAR) ))
|
||||||
NONCLIENTMETRICSA nclm;
|
{
|
||||||
|
NONCLIENTMETRICSW nclm;
|
||||||
HFONT hFont, hOldFont;
|
HFONT hFont, hOldFont;
|
||||||
nclm.cbSize = sizeof(NONCLIENTMETRICSA);
|
nclm.cbSize = sizeof(nclm);
|
||||||
SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
||||||
if (exStyle & WS_EX_TOOLWINDOW)
|
if (exStyle & WS_EX_TOOLWINDOW)
|
||||||
hFont = CreateFontIndirectA (&nclm.lfSmCaptionFont);
|
hFont = CreateFontIndirectW (&nclm.lfSmCaptionFont);
|
||||||
else
|
else
|
||||||
hFont = CreateFontIndirectA (&nclm.lfCaptionFont);
|
hFont = CreateFontIndirectW (&nclm.lfCaptionFont);
|
||||||
hOldFont = SelectObject (hdc, hFont);
|
hOldFont = SelectObject (hdc, hFont);
|
||||||
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
|
if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) );
|
||||||
else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
|
else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) );
|
||||||
SetBkMode( hdc, TRANSPARENT );
|
SetBkMode( hdc, TRANSPARENT );
|
||||||
r.left += 2;
|
r.left += 2;
|
||||||
DrawTextA( hdc, buffer, -1, &r,
|
DrawTextW( hdc, buffer, -1, &r,
|
||||||
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT );
|
DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_LEFT );
|
||||||
DeleteObject (SelectObject (hdc, hOldFont));
|
DeleteObject (SelectObject (hdc, hOldFont));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue