урок на делфи 17 - свернуть программу в трей


задание на delphi. Свернуть и скрыть из панел задач


unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;
type
TForm1 = class(TForm)
TrayIcon1: TTrayIcon;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure TrayIcon1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowWindow(Handle,SW_HIDE);
TrayIcon1.Visible:=true;
end;
procedure TForm1.TrayIcon1Click(Sender: TObject);
begin
TrayIcon1.Visible:=false;
ShowWindow(Handle,SW_NORMAL);
end;
end.



Скачать