win32: fix a regression which make TStaticText draw only using default text color if Transparent = True (bug #0018289)

git-svn-id: trunk@29864 -
This commit is contained in:
paul 2011-03-16 03:39:17 +00:00
parent fe636fc95e
commit 914f7c1903

View File

@ -1388,6 +1388,7 @@ function StaticTextParentMsgHandler(const AWinControl: TWinControl; Window: HWnd
var MsgResult: Windows.LResult; var WinProcess: Boolean): Boolean;
var
Info: PWin32WindowInfo;
TextColor: TColor;
begin
Result := False;
case Msg of
@ -1398,9 +1399,13 @@ begin
if Result then
begin
ThemeServices.DrawParentBackground(HWND(LParam), HDC(WParam), nil, False);
MsgResult := GetStockObject(HOLLOW_BRUSH);
MsgResult := Windows.GetStockObject(HOLLOW_BRUSH);
WinProcess := False;
SetBkMode(HDC(WParam), TRANSPARENT);
Windows.SetBkMode(HDC(WParam), TRANSPARENT);
TextColor := Info^.WinControl.Font.Color;
if TextColor = clDefault then
TextColor := Info^.WinControl.GetDefaultColor(dctFont);
Windows.SetTextColor(HDC(WParam), ColorToRGB(TextColor));
end;
end;
end;