unit acBase;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TBaseForm = class(TForm)
  protected
    procedure InitializeNewForm; override;
  end;

function IniFileName: string;
function LogonIniFileName: string;

implementation

{$R *.DFM}

function IniFileName: string;
begin
  Result := ChangeFileExt(ParamStr(0), '.ini');
end;

function LogonIniFileName: string;
begin
  Result := ChangeFileExt(ParamStr(0), '.ini');
  Insert('Logon', Result, Length(Result) - 3);
end;

{ TBaseForm }

procedure TBaseForm.InitializeNewForm;
var
  NonClientMetrics: TNonClientMetrics;
begin
  inherited;
  NonClientMetrics.cbSize := SizeOf(NonClientMetrics);
  if SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, @NonClientMetrics, 0) then
    Font.Handle := CreateFontIndirect(NonClientMetrics.lfMessageFont);
end;

end.

