unit2.pas

来自「delphi编写的托盘显示软件」· PAS 代码 · 共 56 行

PAS
56
字号
unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDeactivate(Sender: TObject);

  private
    { Private declarations }
     procedure AppOnMinimize(Sender:TObject);

  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}
uses unit1;

procedure TForm2.Button1Click(Sender: TObject);
begin
form1.close;
end;

procedure TForm2.AppOnMinimize(Sender:TObject);
begin
  ShowWindow(application.handle,SW_HIDE);
  //form2.Visible:=true;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
with application do
begin
OnMinimize:=AppOnMinimize;
end;
end;

procedure TForm2.FormDeactivate(Sender: TObject);
begin
application.Minimize;
end;

end.

⌨️ 快捷键说明

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