in Delphi language, interposer_class is an unit that uses interposer technique to add to every TComponent descendant a property of type TQryRecInfo named ORMRec and a property string named ORMRecField.
Adjust the changes to the unit interposer_class:
Additionaly, I want that each TComponent descendant be an interposer that inherits from the interposed TComponent.
How this unit could be enhanced to override CreateParams to any TComponent, without manually adding each one to the interposer unit, in a more organized and efficient way?
something like this that works for every TComponent descendant:

procedure TComponent.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  StrPCopy(Params.WinClassName, 'ZPro');
end;

Please review carefully before make the needed changes.


------------------------

unit interposer_class;

interface

uses
  Vcl.Forms, Vcl.Controls, CommCtrl, Messages, sPanel, sEdit, sPageControl,
  System.Classes, AdvCGrid, Uni, pixel_classes, ORM_utils;

{$TYPEINFO ON}

type
  // Define a base interposer class for TComponent
  TInterposerComponent = class(System.Classes.TComponent)
  private
    FORMRec: TQryRecInfo;
    FORMRecField: string;
  public
    property ORMRec: TQryRecInfo read FORMRec write FORMRec;
    property ORMRecField: string read FORMRecField write FORMRecField;
  end;

  // Interpose TForm with the additional TComponent properties
  TForm = class(Vcl.Forms.TForm)
  private
    FORMRec: TQryRecInfo;
    FORMRecField: string;
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
    property ORMRec: TQryRecInfo read FORMRec write FORMRec;
    property ORMRecField: string read FORMRecField write FORMRecField;
  end;

  // Interpose other TComponent descendants similarly
  TsPanel = class(sPanel.TsPanel)
  private
    FORMRec: TQryRecInfo;
    FORMRecField: string;
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    property ORMRec: TQryRecInfo read FORMRec write FORMRec;
    property ORMRecField: string read FORMRecField write FORMRecField;
  end;

  TsEdit = class(sEdit.TsEdit)
  private
    FORMRec: TQryRecInfo;
    FORMRecField: string;
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    property ORMRec: TQryRecInfo read FORMRec write FORMRec;
    property ORMRecField: string read FORMRecField write FORMRecField;
  end;

  TsPageControl = class(sPageControl.TsPageControl)
  private
    FORMRec: TQryRecInfo;
    FORMRecField: string;
    procedure TCMAdjustRect(var Msg: TMessage); message TCM_ADJUSTRECT;
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    property ORMRec: TQryRecInfo read FORMRec write FORMRec;
    property ORMRecField: string read FORMRecField write FORMRecField;
  end;

  TAdvColumnGrid = class(AdvCGrid.TAdvColumnGrid)
  private
    FByPassAF: TArray<Boolean>;
    FORMRec: TQryRecInfo;
    FORMRecField: string;
    function GetCellz(ACol, ARow: Integer): TZString;
    procedure SetCellz(ACol, ARow: Integer; const Value: TZString);
    function GetBypassAF(ACol: Integer): Boolean;
    procedure SetBypassAF(ACol: Integer; const Value: Boolean);
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  public
    property ORMRec: TQryRecInfo read FORMRec write FORMRec;
    property ORMRecField: string read FORMRecField write FORMRecField;
    property Cellz[ACol, ARow: Integer]: TZString read GetCellz write SetCellz;
    property BypassAutoFit[ACol: Integer]: Boolean read GetBypassAF write SetBypassAF;
  published
    function CriaLinhaObjeto(MyObject: TObject): Integer;
    function CriaLinha: Integer;
    function GetColumnIndexByName(const nome: string): Integer;
    procedure SetBasicColumnConfig;
  end;

implementation

uses
  pixel_utils, System.Math, System.Types, Windows, System.SysUtils, TypInfo,
  Generics.Collections, Data.DB, Vcl.Graphics, ComCtrls, Vcl.Grids;

procedure TForm.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  StrPCopy(Params.WinClassName, 'ZPro');
end;

constructor TForm.Create(AOwner: TComponent);
begin
  inherited;
end;

destructor TForm.Destroy;
begin
  inherited;
end;

procedure TsPanel.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  StrPCopy(Params.WinClassName, 'Painel');
end;

procedure TsEdit.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  StrPCopy(Params.WinClassName, 'Editor');
end;

procedure TsPageControl.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  StrPCopy(Params.WinClassName, 'PagCtrl');
end;

procedure TsPageControl.TCMAdjustRect(var Msg: TMessage);
begin
  inherited;
  case TabPosition of
    tpTop:
      begin
        PRect(Msg.LParam)^.Left := 0;
        PRect(Msg.LParam)^.Right := ClientWidth;
        PRect(Msg.LParam)^.Bottom := ClientHeight;
      end;
  end;
end;

procedure TAdvColumnGrid.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);
  StrPCopy(Params.WinClassName, 'Grid');
end;

function TAdvColumnGrid.GetCellz(ACol, ARow: Integer): TZString;
begin
  Result := Self.Cells[ACol, ARow];
end;

procedure TAdvColumnGrid.SetCellz(ACol, ARow: Integer; const Value: TZString);
begin
  Self.Cells[ACol, ARow] := string(Value);
end;

function TAdvColumnGrid.GetBypassAF(ACol: Integer): Boolean;
begin
  Result := FByPassAF[ACol];
end;

procedure TAdvColumnGrid.SetBypassAF(ACol: Integer; const Value: Boolean);
begin
  if Length(FByPassAF) < ACol + 1 then SetLength(FByPassAF, ACol + 1);
  FByPassAF[ACol] := Value;
end;

function TAdvColumnGrid.CriaLinha: Integer;
begin
  Self.RowCount := Self.RowCount + 1;
  Self.ClearRows(Self.RowCount - 1, 1);
  Result := Self.RowCount - 1;
end;

function TAdvColumnGrid.CriaLinhaObjeto(MyObject: TObject): Integer;
begin
  Self.RowCount := Self.RowCount + 1;
  Self.ClearRows(Self.RowCount - 1, 1);
  Self.Objects[0, Self.RowCount - 1] := MyObject;
  Result := Self.RowCount - 1;
end;

function TAdvColumnGrid.GetColumnIndexByName(const nome: string): Integer;
begin
  Result := 0;
  for var i := 1 to Pred(Self.ColCount) do
    if Self.Columns[i].Name = nome then Exit(i);
end;

procedure TAdvColumnGrid.SetBasicColumnConfig;
var
  i: Integer;
begin
  with Self do
  begin
    SuppressColumn(0);
    for i := 1 to ColCount - 1 do
      if Columns[i].Tag = 0 then
      begin
        Columns[i].HeaderAlignment := taCenter;
        Columns[i].HeaderFont.Name := 'Tahoma';
        Columns[i].HeaderFont.Size := MulDiv(8, 96, Self.CurrentPPI);
        Columns[i].HeaderFont.Color := clWhite;
        Columns[i].HeaderFont.Style := [fsBold];
      end;
    for i := 1 to ColCount - 1 do
      if Columns[i].Tag = 0 then
      begin
        Columns[i].Font.Name := 'Verdana';
        Columns[i].Font.Size := MulDiv(10, 96, Self.CurrentPPI);
        Columns[i].Font.Style := [];
      end;
    for i := 1 to ColCount - 1 do
      if Columns[i].Tag = 0 then
      begin
        Columns[i].ShowBands := True;
        Colors[i, 0] := RGB($41, $3F, $42);
      end;

    for i := 1 to ColCount - 1 do Columns[i].Tag := 1;

    Bands.PrimaryColor := $00EFEFEF;
    Bands.SecondaryColor := $00F9F9F9;
    MouseActions.DirectEdit := True;
    MouseActions.DirectComboDrop := True;
    Bands.Active := True;
    ActiveCellShow := False;
    Navigation.SkipDisabledRows := True;
    Navigation.AutoComboSelect := False;
    ShowSelection := True;
    HideFocusRect := True;
    Options := Options - [goRangeSelect] + [goRowSelect];
    HoverRow := True;
    HoverRowColor := clYellow;
    ActiveRowShow := True;
    ActiveRowColor := clLime;
    SelectionColor := clLime;
    SelectionTextColor := clBlack;
    ColumnSize.Stretch := False;
    ColumnSize.StretchColumn := -1;
    ColumnSize.SynchWithGrid := False;
    FixedRowAlways := True;
    FixedRows := 1;
  end;
end;

end.