diff --git a/lcl/interfaces/win32/win32wscomctrls.pp b/lcl/interfaces/win32/win32wscomctrls.pp index 36de6e3f1b..c1c4a84310 100644 --- a/lcl/interfaces/win32/win32wscomctrls.pp +++ b/lcl/interfaces/win32/win32wscomctrls.pp @@ -49,6 +49,7 @@ type const AParams: TCreateParams): HWND; override; class procedure Update(const AStatusBar: TStatusBar); override; class procedure PanelUpdate(const AStatusBar: TStatusBar; PanelIndex: integer); override; + class procedure SetColor(const AWinControl: TWinControl); override; class procedure SetPanelText(const AStatusBar: TStatusBar; PanelIndex: integer); override; class procedure SetSizeGrip(const AStatusBar: TStatusBar; SizeGrip: Boolean); override; class procedure SetText(const AWinControl: TWinControl; const AText: string); override; @@ -385,6 +386,13 @@ begin UpdateStatusBarPanel(AStatusBar.Panels[PanelIndex]); end; +class procedure TWin32WSStatusBar.SetColor(const AWinControl: TWinControl); +begin + if not WSCheckHandleAllocated(AWinControl, 'TWin32WSStatusBar.SetColor') then + Exit; + Windows.SendMessage(AWinControl.Handle, SB_SETBKCOLOR, 0, ColorToRGB(AWinControl.Color)); +end; + class procedure TWin32WSStatusBar.GetPreferredSize(const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); begin diff --git a/lcl/interfaces/win32/win32wscustomlistview.inc b/lcl/interfaces/win32/win32wscustomlistview.inc index 1c374fa17e..28a781689f 100644 --- a/lcl/interfaces/win32/win32wscustomlistview.inc +++ b/lcl/interfaces/win32/win32wscustomlistview.inc @@ -682,8 +682,8 @@ class procedure TWin32WSCustomListView.SetColor(const AWinControl: TWinControl); begin if not WSCheckHandleAllocated(AWinControl, 'TWin32WSCustomListView.SetColor') then Exit; - Windows.SendMessage(AWinControl.Handle, LVM_SETBKCOLOR, 0, AWinControl.Color); - Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTBKCOLOR, 0, AWinControl.Color); + Windows.SendMessage(AWinControl.Handle, LVM_SETBKCOLOR, 0, ColorToRGB(AWinControl.Color)); + Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTBKCOLOR, 0, ColorToRGB(AWinControl.Color)); end; class procedure TWin32WSCustomListView.SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); @@ -700,7 +700,7 @@ begin // call inherited SetFont; need to do it this way, // because the compile time ancestor class is TWSCustomListView TWSWinControlClass(ClassParent).SetFont(AWinControl, AFont); - Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTCOLOR, 0, AFont.Color); + Windows.SendMessage(AWinControl.Handle, LVM_SETTEXTCOLOR, 0, ColorToRGB(AFont.Color)); end; class procedure TWin32WSCustomListView.SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles);