This bug stems from a bug in CommCtrl.pas. It contains this function:
CODE
function ListView_GetTextColor(hwnd: HWND): TColorRef;
begin
Result := SendMessage(hwnd, LVM_GETTEXTCOLOR, 0, 0);
end;
Because the Result must be a TColorRef (a DWORD), and SendMessage returns a LongInt, a Range Check error may occur. The function should be:
CODE
function ListView_GetTextColor(hwnd: HWND): TColorRef;
begin
Result := TColorRef(SendMessage(hwnd, LVM_GETTEXTCOLOR, 0, 0));
end;
There are a few more cases of this bug:
ListView_GetBkColor
ListView_GetTextBkColor
and
DateTime_GetMonthCalColor
So, in the case of the procedure TacListViewWnd.SaveStdParams in module acSBUtils, the cure would be to do the SendMessage, i.s.o. calling the bugged functions ListView_GetBkColor and ListView_GetTextColor from CommCtrl.