⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formauto.pas

📁 < Delphi网络通信协议分析与应用实现>>一书的源代码。
💻 PAS
字号:
unit FormAuto;

interface

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

type
  TAutoForm = class(TForm)
    procedure FormShow(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    FFormPosFlag : Boolean;
  protected
    FIniFilename : string;
    FSectionName : string;
    FKeyName     : string;
  public
    constructor Create(AOwner : TComponent); override;
  end;

var
  AutoForm: TAutoForm;

implementation

{$R *.DFM}


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
constructor TAutoForm.Create(AOwner : TComponent);
begin
    Inherited Create(AOwner);
    FSectionName := 'Windows';
    FKeyName := Name;
    FIniFileName := Copy(Application.ExeName, 1,
                         Length(Application.ExeName) - 3) + 'ini';
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TAutoForm.FormShow(Sender: TObject);
begin
    if not FFormPosFlag then begin
        FFormPosFlag := TRUE;
        LoadFormPos(Self, FIniFilename, FSectionName, FKeyName);
    end;
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
procedure TAutoForm.FormDestroy(Sender: TObject);
begin
    SaveFormPos(Self, FIniFilename, FSectionName, FKeyName);
end;


{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

end.

{* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -